Hello, I want to know How to read/write disks(the first main disk) using bios on ubuntu protected mode.
First, (use a vm, ), I have disabled the orig ahci/ide linux drivers by rename /lib/modules/`uname -r`/kernel/drivers/ata to /lib/modules/`uname -r`/kernel/drivers/ata_backup. Is this necessary ?
I'm not familier familiar with real mode programming. here is what i got so far:
1. Use "Protected Mode BIOS Call Functionailty" by Napalm, it seems have to write asm.
2. Use LRMI from http://www.codon.org.uk/~mjg59/libx86/, but i I can't found any examples about how to read/write disks.
and my operation system is lubuntu 18.04 32bit, any 32bit system is ok, i think.
Thanks, all
Help,Does any know how to call bios int13 routine on ubuntu?
Help,Does any know how to call bios int13 routine on ubuntu?
- Attachments
-
- lrmi.tar.gz
- downloaded from ubuntu src repo
- (10.13 KiB) Downloaded 26 times
-
- Member
- Posts: 5575
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Help,Does any know how to call bios int13 routine on ubu
Why?atmgnd wrote:Hello, I want to know How to read/write disks(the first main disk) using bios on ubuntu protected mode.
Re: Help,Does any know how to call bios int13 routine on ubu
The reason is I got some sata controller not work well using modern sata/ahci mode.Octocontrabass wrote:Why?atmgnd wrote:Hello, I want to know How to read/write disks(the first main disk) using bios on ubuntu protected mode.
can any one give some examples or resource to do that ? Help wanted. thanks alot.
also, I wonder why there is tools like vbetool(running under real mode), but no tools like rmdisk, realhd ?
-
- Member
- Posts: 5575
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Help,Does any know how to call bios int13 routine on ubu
In that case, you should look at improving the AHCI driver in Linux. (It might even be fixed already, in a newer kernel.)atmgnd wrote:The reason is I got some sata controller not work well using modern sata/ahci mode.
If the SATA controller has a legacy IDE mode, try that and see if it works any better.
Changing the display mode is something that you usually do only once, when the computer boots up. Accessing the hard disk happens all the time. It doesn't matter if you have to pause everything to use the limited, slow BIOS once during boot. But would you like it very much if your computer had to stop everything in order to access the hard disk?atmgnd wrote:also, I wonder why there is tools like vbetool(running under real mode), but no tools like rmdisk, realhd ?
Re: Help,Does any know how to call bios int13 routine on ubu
I have spent alot of time on ahci/sata way, and it's confirmed by the manufacturer there is no future fix plan(some issue to sata controller firmware).Octocontrabass wrote:In that case, you should look at improving the AHCI driver in Linux. (It might even be fixed already, in a newer kernel.)atmgnd wrote:The reason is I got some sata controller not work well using modern sata/ahci mode.
If the SATA controller has a legacy IDE mode, try that and see if it works any better.
Changing the display mode is something that you usually do only once, when the computer boots up. Accessing the hard disk happens all the time. It doesn't matter if you have to pause everything to use the limited, slow BIOS once during boot. But would you like it very much if your computer had to stop everything in order to access the hard disk?atmgnd wrote:also, I wonder why there is tools like vbetool(running under real mode), but no tools like rmdisk, realhd ?
What i plan to is I disable all linux disk drivers, and I will write a simple block/disk driver using bios to read/write disks.
I believe I can handle the linux disk driver part, because there is many examples on internet.
But what I dont know is how to access bios disk routine(lrmi, or asm?).
thanks alot, does any
Re: Help,Does any know how to call bios int13 routine on ubu
And I know the bios is very slow, but I think I am ok with that.
Re: Help,Does any know how to call bios int13 routine on ubu
Even if you could access the BIOS in this way (which I very much doubt), I'll bet a dollar to a cent that the result will be an order of magnitude slower than the Linux driver (however poor it might be).
Re: Help,Does any know how to call bios int13 routine on ubu
Does any one have some examples ( or just some pieces), I currently use a virtual machine to develop/test the prototype, and I no luck so far.
Re: Help,Does any know how to call bios int13 routine on ubu
Of course older programmers (like me) and retro fans can have fond feelings of the BIOS. There is something nostalgic about using an int 13h disk read.
But on Linux and other protected mode (or long mode) operating systems you make a deep sigh and get rid of that 1980s-style, 16bit, complicated, weird Legacy BIOS. You use it for bootloading (including hardware diagnostics ansd setup) and that was it. Afaik even the die-hard BIOS fans don't _want_ to use BIOS in Linux. Well, except in DOSBOX/DOSEMU and Bochs/Qemu and such emulators but not in Linux directly.
And I think sooner or later there will be no Legacy BIOS in the hardware. Because there is EFI/UEFI. Like 386 once was state-of-the-art and is now gone, so will Legacy BIOS be gone some day. Just's at least, what I expect to happen.
The Legacy BIOS and Linux are very different worlds! It is technically possible to reserve all BIOS-relevant memory and constantly jump back between real and protected mode (like DPMI does, for example). But I really don't recommend that. EDIT: And there will probably severe interrupt problems...!
Happy hacking
Peter
But on Linux and other protected mode (or long mode) operating systems you make a deep sigh and get rid of that 1980s-style, 16bit, complicated, weird Legacy BIOS. You use it for bootloading (including hardware diagnostics ansd setup) and that was it. Afaik even the die-hard BIOS fans don't _want_ to use BIOS in Linux. Well, except in DOSBOX/DOSEMU and Bochs/Qemu and such emulators but not in Linux directly.
And I think sooner or later there will be no Legacy BIOS in the hardware. Because there is EFI/UEFI. Like 386 once was state-of-the-art and is now gone, so will Legacy BIOS be gone some day. Just's at least, what I expect to happen.
The Legacy BIOS and Linux are very different worlds! It is technically possible to reserve all BIOS-relevant memory and constantly jump back between real and protected mode (like DPMI does, for example). But I really don't recommend that. EDIT: And there will probably severe interrupt problems...!
Happy hacking
Peter