radix-old/README.md

28 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2023-10-22 11:27:35 +13:00
# Limine C Template
2022-03-26 17:54:00 +13:00
This repository will demonstrate how to set up a basic x86-64 kernel in C using Limine.
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
It is recommended to cross reference the contents of this repository with [the Limine Bare Bones](https://wiki.osdev.org/Limine_Bare_Bones) OSDev wiki page.
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
## How to use this?
2022-06-16 07:07:24 +12:00
2023-09-03 12:06:59 +12:00
### Dependencies
2022-03-26 17:54:00 +13:00
2023-09-10 02:33:28 +12:00
Any `make` command depends on GNU make (`gmake`) and is expected to be run using it. This usually means using `make` on most GNU/Linux distros, or `gmake` on other non-GNU systems.
2023-09-03 12:06:59 +12:00
All `make all*` targets depend on a GNU-compatible C toolchain capable of generating x86-64 ELF objects. Usually `gcc/binutils` or `clang/llvm/lld` provided by any x86-64 UNIX like (including Linux) distribution will suffice.
2022-03-26 17:54:00 +13:00
2023-09-03 12:10:37 +12:00
Additionally, building an ISO with `make all` requires `xorriso`, and building a HDD/USB image with `make all-hdd` requires `sgdisk` (usually from `gdisk` or `gptfdisk` packages) and `mtools`.
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
### Makefile targets
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
Running `make all` will compile the kernel (from the `kernel/` directory) and then generate a bootable ISO image.
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
Running `make all-hdd` will compile the kernel and then generate a raw image suitable to be flashed onto a USB stick or hard drive/SSD.
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
Running `make run` will build the kernel and a bootable ISO (equivalent to make all) and then run it using `qemu` (if installed).
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
Running `make run-hdd` will build the kernel and a raw HDD image (equivalent to make all-hdd) and then run it using `qemu` (if installed).
2022-03-26 17:54:00 +13:00
2023-09-03 12:06:59 +12:00
The `run-uefi` and `run-hdd-uefi` targets are equivalent to their non `-uefi` counterparts except that they boot `qemu` using a UEFI-compatible firmware.