Hello everyone.
So, after I get myself an ATA driver or something to be able to read and and write to and from the disk, how exactly do I go about writing things like the MBR, a bootloader and my kernel to the disk?
The bootloader I'm aiming for is GRUB2, on normal BIOS.
I do not exactly understand how they all fit together, what needs to get written where, things like that.
And another question, is there a way for me to write a GRUB2 module for my own file system?
Cheers,
Chronium.
How to go about writing an OS and bootloader to disk?
Re: Writing an OS and bootloader to disk.
grub-install does grub installation for you, just give it a drive specification (hd0) etc - see GRUB manual for that, it's all detailed there.chronium wrote:Hello everyone.
So, after I get myself an ATA driver or something to be able to read and and write to and from the disk, how exactly do I go about writing things like the MBR, a bootloader and my kernel to the disk?
If you're using grub, you can write the kernel anywhere on a fileystem that is understood by grub.chronium wrote: I do not exactly understand how they all fit together, what needs to get written where, things like that.
Yes, it is possible. Get grub sources https://www.gnu.org/software/grub/grub-download.html and look for implementation of filesystem modules, it's fairly straightforward. E.g. grub-core/fs/fat.c defines a FAT filesystem driver.chronium wrote: And another question, is there a way for me to write a GRUB2 module for my own file system?
Learn to read.
Re: How to go about writing an OS and bootloader to disk?
I don't want to install it using external tools. I'm interested on how to do the installation from inside my kernel. There should be a way to get the stage 1 and 2 files, write the stage 1 where it should be and then do the rest for stage 2, but that's what I don't quite get how to do.
Where exactly each part of the bootloader should go
Where exactly each part of the bootloader should go
Re: How to go about writing an OS and bootloader to disk?
the first ,,stage'' goes to the first sector.
the second goes
the second goes
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html
Re: How to go about writing an OS and bootloader to disk?
You can inspect the sources of grub-install and figure where, how and why it is written.chronium wrote: Where exactly each part of the bootloader should go
Learn to read already.
Learn to read.