https://github.com/plos-clan/multiboot-xmake-template
Multiboot and xmake help you to start your x86 LegacyBIOS kernel life
https://github.com/plos-clan/multiboot-xmake-template
multiboot xmake
Last synced: 11 months ago
JSON representation
Multiboot and xmake help you to start your x86 LegacyBIOS kernel life
- Host: GitHub
- URL: https://github.com/plos-clan/multiboot-xmake-template
- Owner: plos-clan
- License: mit
- Created: 2024-11-01T04:34:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-11T11:12:28.000Z (over 1 year ago)
- Last Synced: 2025-01-18T02:28:26.685Z (over 1 year ago)
- Topics: multiboot, xmake
- Language: C
- Homepage:
- Size: 234 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multiboot C xmake Template
This repository contains a basic x86 kernel in C using Multiboot.
## About
The template source code is borrowed from "CP_Kernel".
Tested by x86 physical machine platform, there are no obvious bugs.
## Dependencies
* `xmake` `xorriso`
> When first running `xmake`, it will download zig as cross-compiler.
> If you choose to use the GRUB bootloader, you will need to install `grub-pc-bin`
## Xmake targets
Running `xmake` will build the kernel and create a bootable ISO image.
Running `xmake run` will build above automatically and run it in QEMU.
## How to enable vbe video mode
Open `src/boot/boot.asm`, comment out `Text Mode` section and uncomment `VBE Video Mode` section.
> VBE Graphics memory address: `multiboot->framebuffer_addr` \
> Video width `multiboot->framebuffer_width` \
> Video height `multiboot->framebuffer_height`
## About GRUB Bootloader
1. Create file `assets/boot/grub/grub.cfg`
```c
set timeout=60
set default=0
menuentry "ExampleOS" {
multiboot /kernel.elf
boot
}
```
2. You'll need to comment out the "Limine Build ISO" section in `xmake.lua`
3. Replace the "Limine Build ISO" section in `xmake.lua` with `os.run("grub-mkrescue -o %s %s", iso_file, iso_dir)`