1
1
Fork 0
kernel/README.md

60 lines
1.8 KiB
Markdown

# rOSka
- Probably useless hobby OS project
- Targets 32bit legacy systems with graphical framebuffer
- Boots with multiboot compatible bootloader, such as GRUB
- Assembles with FASM
- We'll probably use ext2 filesystem
## GRUB disk creation
1. Format disk. Create ext2 partition
2. Create directory mnt and mount your partition to it
```
mkdir mnt
sudo mount /dev/sdX1 mnt
```
3. Intall grub using `sudo grub-install --target=i386-pc --removable --boot-dir=mnt/boot /dev/sdX`
4. Create config
``` mnt/boot/grub/grub.cfg
menuentry "rOSka" {
multiboot /boot/roska.bin
boot
}
```
5. Copy assembled kernel to `mnt/boot/roska.bin`
## extlinux disk creation
1. Format disk. Create ext2 partition and mark it active boot partition.
2. Add syslinux to bootloader
`sudo dd if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sdX`
3. Create directory mnt and mount your partition to it. Add boot directory to it.
```
mkdir mnt
sudo mount /dev/sdX1 mnt
sudo mkdir mnt/boot
```
4. Install extlinux(syslinux)
```
sudo extlinux --install --device /dev/sdX1 mnt/boot
sudo cp /usr/lib/syslinux/bios/libcom32.c32 mnt/boot/
sudo cp /usr/lib/syslinux/bios/mboot.c32 mnt/boot/
```
5. Create config
``` mnt/boot/syslinux.cfg
DEFAULT rOSka
LABEL rOSka
SAY extlinux is booting rOSka...
KERNEL /boot/mboot.c32
APPEND /boot/roska.bin
```
6. Copy assembled kernel to `mnt/boot/roska.bin`
7. Have no video because naughty implementation doesn't tell
us the framebuffer address :(
Oh yeah heres a montrosity I currently use.
`fasm roska.fasm && sudo mount /dev/sdd1 mnt/ && sudo cp roska.bin mnt/boot/roska.bin && sudo umount /dev/sdd1 && sudo sync && sudo qemu-system-i386 /dev/sdd`