bootloader/README.md

77 lines
914 B
Markdown
Raw Permalink Normal View History

2025-01-10 20:46:47 +00:00
# bootloader
2025-01-11 18:54:50 +00:00
A tiny 32-bit x86 operating system kernel
http://3zanders.co.uk/2017/10/13/writing-a-bootloader/
## Real Mode Boot 1
16-bit mode.
Assemble with
``` shell
nasm -f bin boot1.asm -o boot1.bin
```
Run with
``` shell
qemu-system-x86_64 -fda boot1.bin
```
## Protected Mode Boot 2
32-bit mode.
Assemble with
``` shell
nasm -f bin boot2.asm -o bin2.bin
```
Run with
``` shell
qemu-system-x86_64 -fda boot2.bin
```
## Extended Boot 3
32-bit, 1024 byte.
Assemble with
``` shell
nasm -f bin boot3.asm -o boot3.bin
```
Run with
``` shell
qemu-system-x86_64 -fda boot3.bin
```
## Linking with Zig
32-bit, 1024 byte, building and linking in Zig code.
Build with
``` shell
zig build-exe boot4.o fun.zig -T linker.ld -nostdlib -target x86-freestanding
```
Convert to raw binary (strip ELF)
```shell
objcopy -Obinary fun fun.bin
```
Run with
``` shell
qemu-system-x86_64 -fda fun.bin
```