Limine Bare Bones: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
No edit summary
No edit summary
Line 21:
As one may notice, there is no "entry point" assembly stub, as one is not necessary with the Limine protocol when using a language which can make use of a standard SysV x86 [[Calling Conventions|calling convention]].
 
Furthermore, we will download the header file '''<code>limine.h'''</code> which defines structures and constants that we will use to interact with the bootloader from [https://github.com/limine-bootloader/limine/raw/trunk/limine.h here], and place it in the '''<code>src'''</code> directory.
 
Obviously, this is just a bare bones example, and one should always refer to the [https://github.com/limine-bootloader/limine/blob/trunk/PROTOCOL.md Limine protocol specification] for more details and information.
Line 226:
 
In order to build our kernel, we are going to use a Makefile. Since we're going to use
GNU make specific features, we call this file '''<code>GNUmakefile'''</code> instead, so only
GNU make will process it.
 
Line 382:
===Compiling the kernel===
 
We can now build our example kernel by running '''<code>make'''</code>. This command, if successful, should generate, inside the '''<code>bin'''</code> directory, a file called '''<code>myos'''</code> (or the chosen kernel name). This is our Limine protocol-compliant kernel executable.
 
===Compiling the kernel on macOS===
Line 388:
''If you are not using macOS, you can skip this section.''
 
The macOS Xcode toolchain uses Mach-O binaries, and not the ELF binaries required for this Limine-compliant kernel. A solution is to build a [[GCC Cross-Compiler]], or to obtain one from [https://brew.sh homebrew] by installing the '''<code>x86_64-elf-gcc'''</code> package. After one of these is done, build using '''<code>make KCC=x86_64-elf-gcc KLD=x86_64-elf-ld'''</code>.
 
===Creating the image===
Line 398:
In this example we are going to create a CD-ROM ISO capable of booting on both [[UEFI]] and legacy [[BIOS]] systems.
 
For this to work, we will need the '''<code>xorriso'''</code> utility.
 
These are shell commands. They can also be compiled into a script or Makefile.
Line 437:
====Creating a hard disk/USB drive image====
 
In this example, we'll create a [[GPT]] partition table using '''<code>sgdisk'''</code>, containing a single FAT partition, also known as the ESP in EFI terminology, which will store our kernel, configs, and bootloader.
 
This example is more involved and is made up of more steps than creating an ISO image.