loading your OS into the HDD ?
loading your OS into the HDD ?
How would you make your OS save into the HDD and load from it the next time the computer turns on ?
any docs, tuts, example code all appreciated, Im pretty sure I need to add it to the IDT table.
docs on reading and writing to HD or reading files from it appreciated as I want to load text from a txt file, pretty sure all I have to do is access the memory address and load it to video memory to display it.
Thnx in advance
any docs, tuts, example code all appreciated, Im pretty sure I need to add it to the IDT table.
docs on reading and writing to HD or reading files from it appreciated as I want to load text from a txt file, pretty sure all I have to do is access the memory address and load it to video memory to display it.
Thnx in advance
There are two thing you want to do.
1)Make your OS boot from HD:Use GRUB for this matter, it is a bootloader you can find many tutorials on this site, or on osdever.net, in tutorials section. You can use GRUB to let your kernel boot from floppy,HD,net etc without changing it. Or you can use your own bootloader, but it is much more complicated.
2)Make your OS read/write from HD: You can not find any harddisk data in memory unless you load it there. If your OS is 16-bit the best solution is to use BIOS to do it for you. You can find BIOS services under various INTerrupts. Harddisk is 0x13 i thing. Just look it up in Ralph's brown interrupt list or somewhere else. Wen your OS is 32-bit it's more difficult to call BIOS whih is 16 bit, but you can still do it using switching to/from protected mode or by vm86 mode. Or you can use direct riting reading. I thing you can just search this forum, or look at the wiki it should be there.
And BTW for everybody who can read Czech I recommand Athelp .
1)Make your OS boot from HD:Use GRUB for this matter, it is a bootloader you can find many tutorials on this site, or on osdever.net, in tutorials section. You can use GRUB to let your kernel boot from floppy,HD,net etc without changing it. Or you can use your own bootloader, but it is much more complicated.
2)Make your OS read/write from HD: You can not find any harddisk data in memory unless you load it there. If your OS is 16-bit the best solution is to use BIOS to do it for you. You can find BIOS services under various INTerrupts. Harddisk is 0x13 i thing. Just look it up in Ralph's brown interrupt list or somewhere else. Wen your OS is 32-bit it's more difficult to call BIOS whih is 16 bit, but you can still do it using switching to/from protected mode or by vm86 mode. Or you can use direct riting reading. I thing you can just search this forum, or look at the wiki it should be there.
And BTW for everybody who can read Czech I recommand Athelp .
Hi.
The answer is from the wiki page on GRUB:R2_ wrote:well either way Im going to have to write grub and my kernel to the HD and modify the menu.lst to point to hard drive which is what I do not know how to do. btw does GRUB enable the a20 line and get you into protected mode ?
One major advantage of GRUB (or more precisely, a multiboot standard bootloader) is that the kernel will be entered in a known state, which includes the A20 Line having been enabled, and Protected Mode having been entered.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
What don't you understand? Grub is installed on the hardrives MBR and then it simply reads a kernel thats on one of the drives partitions.R2_ wrote:Thnx, still I don't get how to programmatically get grub to install/be written into the HD Along with my kernel.
To install grub on a drive usually you read the manual, Prepare the drive using linux for example.
Not rocket science buddy, Google It
Try the GRUB manual?R2_ wrote:Thnx, still I don't get how to programmatically get grub to install/be written into the HD Along with my kernel.
Every good solution is obvious once you've found it.
Well my problem isn't with grub is with writing files to the HD overall. I know I can use linux and boot off the HD but thats not what I want the users of my OS to have to do every time they want to install my OS... I wouldn't like to have to download linux or unix every time im installing an OS, Ill read up on the GRUB manual maybe theres something there.