Read data of harddrive in pmode(in C)????

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
RharryR
Posts: 17
Joined: Thu Feb 11, 2016 1:15 am
Location: Milingimbi Island, Australia

Read data of harddrive in pmode(in C)????

Post by RharryR »

Hey yall.
I have got most of the nitty gritty parts of my operating done(gdt, idt, exceptions, irq, still missing a memory manager) and now I would like to implement a file system.
I have good experience with FAT, and i should be fine with parsing and processing filesystem data, but my problem is getting data. How can I read data of the harddrive(not floppy) in protected mode? I am writing my kernel in C and i would prefer to use as little assembler as possible. So again, how, in C, can i read of a harddrive in protected mode? Thanks

P.S. Whenever i said harddrive i really meant 'harddisk'
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: Read data of harddrive in pmode(in C)????

Post by MollenOS »

First of all I'd recommend writing a memory manager if you still haven't done one before writing drivers.

Second, you need to first iterate pci space to see which storage controllers actually are available (ide, AHCI etc) and then you need to write the storage driver for the available controllers (probably IDE or AHCI)
RharryR
Posts: 17
Joined: Thu Feb 11, 2016 1:15 am
Location: Milingimbi Island, Australia

Re: Read data of harddrive in pmode(in C)????

Post by RharryR »

Hia.
I know this a complete different question, but how would i write this memory manager. I cant find any resources on it....

Thanks for the quick reply
FallenAvatar
Member
Member
Posts: 283
Joined: Mon Jan 03, 2011 6:58 pm

Re: Read data of harddrive in pmode(in C)????

Post by FallenAvatar »

Next time, look through the wiki before posting here. (Hint: the answers to both of your questions and answered fully in the wiki)

- Monk
Post Reply