How do I read and write to the hard disk with assembly or C, without using INT 13h? I am trying to keep up to date and Intel is dropping support for PC BIOS in favor for UEFI, I am new, but want to have a modern OS. Most of the stuff I see online these days only works on IBM PCs, and I want mine to run on a 2010 Dell Laptop running Linux.
Thx,
Checkov
Hard disk control
- PavelChekov
- Member
- Posts: 113
- Joined: Mon Sep 21, 2020 9:51 am
- Location: Aboard the Enterprise
Hard disk control
USS Enterprise NCC-1701,
The Final Frontier,
Space,
The Universe
Live Long And Prosper
Slava Ukraini!
Слава Україні!
The Final Frontier,
Space,
The Universe
Live Long And Prosper
Slava Ukraini!
Слава Україні!
Re: Hard disk control
You need to write a PATA (IDE)/SATA (AHCI) driver.
Check out: https://wiki.osdev.org/Storage
Check out: https://wiki.osdev.org/Storage
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: Hard disk control
In general, storage is not UEFI/BIOS specific, but usually mapped to the PCI bus.
There might be a UEFI function to read the disk, but you're probably better off writing a IDE or AHCI driver.
I would assume that a 2010 laptop would be AHCI SATA, so take a look at the AHCI page.
AHCI is a bit harder than IDE to program but has a lot more features.
It is also possible that your laptop could have IDE emulation in the BIOS/UEFI settings.
However, have you verified that your laptop is UEFI? AFAIK 2010 is pretty early for UEFI.
And what do you mean by "2010 Dell Laptop running Linux"?
Is Linux the current operating system? You don't need any operating system to run an operating system unless you're emulating it.
There might be a UEFI function to read the disk, but you're probably better off writing a IDE or AHCI driver.
I would assume that a 2010 laptop would be AHCI SATA, so take a look at the AHCI page.
AHCI is a bit harder than IDE to program but has a lot more features.
It is also possible that your laptop could have IDE emulation in the BIOS/UEFI settings.
However, have you verified that your laptop is UEFI? AFAIK 2010 is pretty early for UEFI.
And what do you mean by "2010 Dell Laptop running Linux"?
Is Linux the current operating system? You don't need any operating system to run an operating system unless you're emulating it.
My OS: TritiumOS
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
https://github.com/foliagecanine/tritium-os
void warranty(laptop_t laptop) { if (laptop.broken) return laptop; }
I don't get it: Why's the warranty void?
- PavelChekov
- Member
- Posts: 113
- Joined: Mon Sep 21, 2020 9:51 am
- Location: Aboard the Enterprise
Re: Hard disk control
I simply meant that whatever it is should compile or such on NASM and GCC
USS Enterprise NCC-1701,
The Final Frontier,
Space,
The Universe
Live Long And Prosper
Slava Ukraini!
Слава Україні!
The Final Frontier,
Space,
The Universe
Live Long And Prosper
Slava Ukraini!
Слава Україні!
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: Hard disk control
Ah okay. So you were saying the build machine runs Linux.
Good luck!
Good luck!
- PavelChekov
- Member
- Posts: 113
- Joined: Mon Sep 21, 2020 9:51 am
- Location: Aboard the Enterprise
Re: Hard disk control
The thing is, I have also created my own file system.
USS Enterprise NCC-1701,
The Final Frontier,
Space,
The Universe
Live Long And Prosper
Slava Ukraini!
Слава Україні!
The Final Frontier,
Space,
The Universe
Live Long And Prosper
Slava Ukraini!
Слава Україні!
-
- Member
- Posts: 148
- Joined: Sun Aug 23, 2020 4:35 pm
Re: Hard disk control
The filesystem driver goes on top of the hard disk driver.
Basically, you first want to be able to read and write sectors to the disk before you worry about files.
Basically, you first want to be able to read and write sectors to the disk before you worry about files.
Re: Hard disk control
First you must find out what protocol is used for your laptop's harddisk. ATA/IDE? Serial ATA (SATA)? SCSI?PavelCheckov wrote:How do I read and write to the hard disk with assembly or C, without using INT 13h? I am trying to keep up to date and Intel is dropping support for PC BIOS in favor for UEFI, I am new, but want to have a modern OS. Most of the stuff I see online these days only works on IBM PCs, and I want mine to run on a 2010 Dell Laptop running Linux.
Octacone gave you a useful link for disk programming.
Greetings
Peter