BOOTBOOT: Difference between revisions

no edit summary
[unchecked revision][unchecked revision]
No edit summary
 
(7 intermediate revisions by one other user not shown)
Line 18:
* CDROM, El Torito UEFI boot Extension (x86_64)
* ISOLINUX / LILO / BOOTLIN / etc. (x86_64 via the Linux kernel boot protocol)
* COREBOOT: as a primary payload in ROM (x86_64)
 
For GRUB compatibility, BOOTBOOT is also Multiboot compliant, so you can add it to the grub.cfg in it's own entry. This is useful if want to dual boot multiple OSes.
Line 27 ⟶ 28:
If despite the warning you decide to [[Roll Your Own Filesystem]], then BOOTBOOT is definitely for you. You can either write an FS module (one function), or just make sure the kernel is the first executable in the archive / on the partition. BOOTBOOT is capable of loading kernels from unknown file systems as well.
 
Optionally you can load your OS from ROM (see qemu's -option-rom command line argument, or bochs rc file; or with [https://coreboot.org coreboot] as a BIOS using qemu -bios), and the Raspberry Pi version can also load the ramdisk over serial line. Although it's not implemented as of yet, the BOOTBOOT protocol allows loading the initrd from a TFTP server.
 
== Your Kernel ==
 
You can use ELF64 or PE32+ formats for your kernel. You must link it as a [[Higher Half Kernel]], and your entry point should point to [[Long Mode]] code. That's all. Unlike all the other boot protocols (e.g. [[Multiboot]] and [[stivale]]), there's absolutely no need for special sections nor for magic structs, unimplementable in some languages. No real mode nor protected mode trampoline code needed at alleither, which simplifies your build environment significantly. Example linker script provided for both x86_64 and AArch64. There are [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel example kernels] forwritten in [[C]], and[[C++]], [[Pascal]], [[Ada]], [[Rust]] and [[Go]].
 
BOOTBOOT passes a configuration to your kernel in a newline separated, zero-terminated UTF-8 string. Each line contains a ''key=value'' pair, where only two keys, "screen" and "kernel" are reserved. You are free to use any other keys that your kernel wishes to use.
Line 37 ⟶ 38:
== Console ==
 
BOOTBOOT does not support VGA text mode, it sets up graphic mode regardless to the platform. You don't have to mess around with [[VESA]] or [[GOP]] any more, you will get the frame buffer ready to use. The example Hello World kernel provided with the BOOTBOOT source has a minimal puts() example, which outputs text on that frame buffer using [[PC Screen Font]] (same that Linux Console uses). You can also use the [[Scalable Screen Font]] library's ''ssfn_putc()''.
 
The loader also initializes the [[Serial_Ports|serial console]] for you with 115200 baud, 8 data bits, no parity and 1 stop bit. Your kernel can send debug messages from the start.
Line 60 ⟶ 61:
*[https://gitlab.com/bztsrc/bootboot Source on Gitlab] the repository
*[https://gitlab.com/bztsrc/bootboot/raw/master/bootboot_spec_1st_ed.pdf BOOTBOOT Specification] and user's manual in PDF format
*[https://gitlab.com/bztsrc/bootboot/tree/master/mykernel Example Hello World Kernel] in C with Makefile and minimal linker script
*[https://gitlab.com/bztsrc/bootboot/tree/master/mykernel-rust Example Hello World Kernel] in Rust
*[https://gitlab.com/bztsrc/bootboot/tree/master/mkbootimg mkbootimg] simple to use, dependency-free [[Bootable_Disk|bootable disk]] creator
*[https://gitlab.com/bztsrc/bootboot/tree/master/mykernel Example Hello World KernelKernels] in C with Makefile and minimal linker script
*Mykernel in [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel/c C]
*Mykernel in [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel/cpp C++]
*Mykernel in [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel-/rust Example Hello World KernelRust] in Rust
*Mykernel in [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel/pas Pascal]
*Mykernel in [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel/ada Ada]
*Mykernel in [https://gitlab.com/bztsrc/bootboot/tree/master/mykernel/go Go]
 
[[Category:Bootloaders]]
[[Category:ARM]]
[[Category:Raspberry Pi]]
[[Category:x86-64]]
[[Category:UEFI]]
 
[[de:BOOTBOOT]]
Anonymous user