Limine Bare Bones: Difference between revisions

Jump to navigation Jump to search
no edit summary
[unchecked revision][unchecked revision]
m (1 revision imported: import new edit)
No edit summary
Tag: Manual revert
Line 29:
This is the kernel "main".
 
<sourcesyntaxhighlight lang="c">
#include <stdint.h>
#include <stddef.h>
Line 155:
}
 
</syntaxhighlight>
</source>
 
===linker.ld===
Line 161:
This is going to be our linker script describing where our sections will end up in memory.
 
<sourcesyntaxhighlight lang="c">
/* Tell the linker that we want an x86_64 ELF64 output file */
OUTPUT_FORMAT(elf64-x86-64)
Line 236:
}
 
</syntaxhighlight>
</source>
 
==Building the kernel and creating an image==
Line 246:
GNU make will process it.
 
<sourcesyntaxhighlight lang="make">
# Nuke built-in rules and variables.
override MAKEFLAGS += -rR
Line 373:
clean:
rm -rf bin obj
</syntaxhighlight>
</source>
 
===limine.cfg===
Line 379:
This file is parsed by Limine and it describes boot entries and other bootloader configuration variables. Further information [https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md here].
 
<sourcesyntaxhighlight lang="ini">
# Timeout in seconds that Limine will use before automatically booting.
TIMEOUT=5
Line 399:
 
KERNEL_PATH=boot:///boot/myos
</syntaxhighlight>
</source>
 
===Compiling the kernel===
Line 423:
These are shell commands. They can also be compiled into a script or Makefile.
 
<sourcesyntaxhighlight lang="bash">
# Download the latest Limine binary release for the 7.x branch.
git clone https://github.com/limine-bootloader/limine.git --branch=v7.x-binary --depth=1
Line 454:
# Install Limine stage 1 and 2 for legacy BIOS boot.
./limine/limine bios-install image.iso
</syntaxhighlight>
</source>
 
====Creating a hard disk/USB drive image====
Line 464:
These are shell commands. They can also be compiled into a script or Makefile.
 
<sourcesyntaxhighlight lang="bash">
# Create an empty zeroed-out 64MiB image file.
dd if=/dev/zero bs=1M count=0 seek=64 of=image.hdd
Line 491:
mcopy -i image.hdd@@1M limine/BOOTX64.EFI ::/EFI/BOOT
mcopy -i image.hdd@@1M limine/BOOTIA32.EFI ::/EFI/BOOT
</syntaxhighlight>
</source>
 
==Conclusions==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu