Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

int 0x13 utility
I recently bought a SATA controller for my old Pentium III box, and
plugged it in. Hooked up a 120GB SATA hard disk, booted up with MSDOS
6.22. Imagine my surprise when MSDOS FDISK refused to create a
partition larger than 503MB even though it was specifically told it
could use the large disk feature. Upgrading the SATA controller BIOS
made no different, it was still a maximum of 503MB.

MSDOS boots just fine, it just can't use partitions larger than 503MB
with that SATA disk and controller.

I have MSDOS correctly installed in a 2GB partition on a PATA disk
connected to the motherboard, so I know the problem isn't with the
motherboard's BIOS.

So, I wrote a tiny utility program in NASM to get the disk parameters
via the int 0x13 / AH = 8. The parameters it reporte are correct for
the hard disks connected to my PC's motherboard, but when it queried
the BIOS for the parameters of its SATA hard disk, it reported: 16
heads, 1022 cylinders and 63 sectors. Ah! That's why MSDOS couldn't
create partitions larger than 503MB!

I've told the manufacturers of the SATA that they need to fix their
BIOS - hopefully they might release an updated BIOS for the SIL3114
controller - fingers crossed. If they won't... I might have to fix it
myself, and that is NOT an easy job!

This utility also checks for the extended Int 0x13 / AH = 0x48 service
but I haven't written the code to print out the values yet - that'll
come as soon as I can find a PC that supports that.

You may find the utility along with its source code at
http://www.munted.org.uk/programming/int0x13.zip

Enjoy!
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-22-08 11:58 PM


Re: int 0x13 utility
Lets start with the formula: 1024 * 256 * 63 * 512 = 8,455,716,864.
Most BIOSes do not use 1024 and 256, but subtract one from each.  That
is somewhat an artifact of the old IBM AT where the last cylinder was
never allocated to allow the IBM Advanced Diagnostics to use it for
read/write testing of the old MFM hard drive.

The extended BIOS functions INT 13h, functions 4Xh allow packets to be
used to detail larger hard drives.  I do not believe that MS-DOS 6.22
will use that access method, but I know that MS-DOS 7.x does.  It
shipped with Windows 95, 98, 98SE, and Me in various minor version
numbers.  I believe that IBM DOS was updated to handle this access.

Most SATA controller vendors probably don't even think about MS-DOS
anymore.  You could write a small device driver that would hook INT
13h and for the second drive return a CHS value that is larger.  I
would also consider disabling any ATAPI/IDE controllers on the
motherboard so the new drive is assigned 80h for the DL value.

I personally use USB drives to boot MS-DOS whenever I need it, but it
does require a later motherboard compared to the Pentium III.

On Sat, 22 Mar 2008 15:30:31 +0000, Alex Buell  <spamtrap@crayne.org>
wrote:

>I recently bought a SATA controller for my old Pentium III box, and
>plugged it in. Hooked up a 120GB SATA hard disk, booted up with MSDOS
>6.22. Imagine my surprise when MSDOS FDISK refused to create a
>partition larger than 503MB even though it was specifically told it
>could use the large disk feature. Upgrading the SATA controller BIOS
>made no different, it was still a maximum of 503MB.
>
>MSDOS boots just fine, it just can't use partitions larger than 503MB
>with that SATA disk and controller.
>
>I have MSDOS correctly installed in a 2GB partition on a PATA disk
>connected to the motherboard, so I know the problem isn't with the
>motherboard's BIOS.
>
>So, I wrote a tiny utility program in NASM to get the disk parameters
>via the int 0x13 / AH = 8. The parameters it reporte are correct for
>the hard disks connected to my PC's motherboard, but when it queried
>the BIOS for the parameters of its SATA hard disk, it reported: 16
>heads, 1022 cylinders and 63 sectors. Ah! That's why MSDOS couldn't
>create partitions larger than 503MB!
>
>I've told the manufacturers of the SATA that they need to fix their
>BIOS - hopefully they might release an updated BIOS for the SIL3114
>controller - fingers crossed. If they won't... I might have to fix it
>myself, and that is NOT an easy job!
>
>This utility also checks for the extended Int 0x13 / AH = 0x48 service
>but I haven't written the code to print out the values yet - that'll
>come as soon as I can find a PC that supports that.
>
>You may find the utility along with its source code at
>http://www.munted.org.uk/programming/int0x13.zip
>
>Enjoy!


Report this thread to moderator Post Follow-up to this message
Old Post
dave
03-22-08 11:58 PM


Re: int 0x13 utility
Hi,

On Mar 22, 10:30 am, Alex Buell  <spamt...@crayne.org> wrote:
> I recently bought a SATA controller for my old Pentium III box, and
> plugged it in. Hooked up a 120GB SATA hard disk, booted up with MSDOS
> 6.22. Imagine my surprise when MSDOS FDISK refused to create a
> partition larger than 503MB even though it was specifically told it
> could use the large disk feature.

Maybe their FDISK doesn't support SATA? The only one I know of that
for sure does is SPFDISK:

http://sourceforge.net/projects/spfdisk

> but when it queried
> the BIOS for the parameters of its SATA hard disk, it reported: 16
> heads, 1022 cylinders and 63 sectors. Ah! That's why MSDOS couldn't
> create partitions larger than 503MB!

So it's a BIOS issue? Hmmm, that might be tough to get fixed. (Yes,
it's a shame no one is supporting DOS these days. They must be too
busy or maybe can't be bothered. Meh.)

P.S. Not to nag too hard, but MS-DOS 6.22 is quite old, and although I
think you should keep it "for comparison", you might get more use out
of FreeDOS (with FAT32, at least), especially since 1.1 "official" is
in the works:

http://rugxulo.googlepages.com


Report this thread to moderator Post Follow-up to this message
Old Post
Rugxulo
03-23-08 11:59 PM


Re: int 0x13 utility
On Sat, 22 Mar 2008 16:27:30 -0700, I waved a wand and this message
magically appears in front of dave:

> Lets start with the formula: 1024 * 256 * 63 * 512 = 8,455,716,864.
> Most BIOSes do not use 1024 and 256, but subtract one from each.  That
> is somewhat an artifact of the old IBM AT where the last cylinder was
> never allocated to allow the IBM Advanced Diagnostics to use it for
> read/write testing of the old MFM hard drive.

Yes, that's correct according to the various documentation I've seen on
the 'net for the AH = 8 / Int 0x13 BIOS calls.

> The extended BIOS functions INT 13h, functions 4Xh allow packets to be
> used to detail larger hard drives.  I do not believe that MS-DOS 6.22
> will use that access method, but I know that MS-DOS 7.x does.  It
> shipped with Windows 95, 98, 98SE, and Me in various minor version
> numbers.  I believe that IBM DOS was updated to handle this access.

Thanks for reminding me about MSDOS 7.x, I'll look into that as well.

> Most SATA controller vendors probably don't even think about MS-DOS
> anymore.  You could write a small device driver that would hook INT
> 13h and for the second drive return a CHS value that is larger.  I
> would also consider disabling any ATAPI/IDE controllers on the
> motherboard so the new drive is assigned 80h for the DL value.

They ought to; there's still a lot of people using DOS these days.

> I personally use USB drives to boot MS-DOS whenever I need it, but it
> does require a later motherboard compared to the Pentium III.

Again that's down to the BIOS having the appropriate calls to be able
to boot off CDROMs / USB keys.

Thanks for the information.

I'm now busy on another project; a sub-2k program to scan the PCI bus
and print out all devices on it.

Regards,
Alex
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-23-08 11:59 PM


Re: int 0x13 utility
Alex Buell schrieb:
> I'm now busy on another project; a sub-2k program to scan the PCI bus
> and print out all devices on it.

Like 'lspci'?


Hendrik vdH


Report this thread to moderator Post Follow-up to this message
Old Post
Hendrik van der Heijden
03-25-08 03:04 AM


Re: int 0x13 utility
On Mon, 24 Mar 2008 14:50:21 +0100, I waved a wand and this message
magically appears in front of Hendrik van der Heijden:
 
>
> Like 'lspci'?

Yup, only in x86 assembler, for a bit of a challenge!
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-25-08 03:04 AM


Re: int 0x13 utility
Hi,

On Mar 24, 4:15 pm, Alex Buell  <spamt...@crayne.org> wrote:
> On Mon, 24 Mar 2008 14:50:21 +0100, I waved a wand and this message
> magically appears in front of Hendrik van der Heijden:
> 
> 
>
> Yup, only in x86 assembler, for a bit of a challenge!

It may have already been done:

http://www.coli.uni-saarland.de/~er...p-2005mar12.zip
http://www.coli.uni-saarland.de/~er...ls/berndpci.zip


Report this thread to moderator Post Follow-up to this message
Old Post
Rugxulo
03-26-08 12:01 AM


Re: int 0x13 utility
Alex Buell wrote:
> So, I wrote a tiny utility program in NASM to get the disk parameters
> via the int 0x13 / AH = 8. The parameters it reporte are correct for
> the hard disks connected to my PC's motherboard, but when it queried
> the BIOS for the parameters of its SATA hard disk, it reported: 16
> heads, 1022 cylinders and 63 sectors. Ah! That's why MSDOS couldn't
> create partitions larger than 503MB!

If you access a HD using BIOS w/CHS, you'll never access past 8GB. If the
BIOS' (or driver's) routines don't support the more recent CHS feature that
allows it to map "big" disks to a virtual CHS geometry, you'll be even more
limited.

As someone pointed already, it's pretty likely that MS-DOS 6.22 does not
support LBA routines, so it'll use CHS (which implies a maximum of 8GB). If
the SATA BIOS does not support the virtual mapping I mentioned above in
it's CHS-based routines, then you'll be even more limited (I think it's the
case).

Try FreeDOS, or write a wrapper that hooks int0x13 CHS routines and maps
virtual CHS addresses to LBA. You'll still be limited to 8GB, though...

JJ


Report this thread to moderator Post Follow-up to this message
Old Post
João Jerónimo
03-26-08 12:01 AM


Re: int 0x13 utility
On Tue, 25 Mar 2008 01:11:15 -0700 (PDT), I waved a wand and this
message magically appears in front of Rugxulo:
 
>
> It may have already been done:
>
> http://www.coli.uni-saarland.de/~er...p-2005mar12.zip
> http://www.coli.uni-saarland.de/~er...ls/berndpci.zip

I'm only doing this for a challenge, and to see if I can squeeze it
just under 2k.
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-26-08 12:01 AM


Re: int 0x13 utility
On Tue, 25 Mar 2008 13:57:36 +0000, I waved a wand and this message
magically appears in front of João Jerónimo:

> As someone pointed already, it's pretty likely that MS-DOS 6.22 does
> not support LBA routines, so it'll use CHS (which implies a maximum
> of 8GB). If the SATA BIOS does not support the virtual mapping I
> mentioned above in it's CHS-based routines, then you'll be even more
> limited (I think it's the case).

That is *exactly* what I've been saying - I even emailed Silicon Images
about their BIOS; they might fix it or I might have to patch it myself
to put out the right numbers.

> Try FreeDOS, or write a wrapper that hooks int0x13 CHS routines and
> maps virtual CHS addresses to LBA. You'll still be limited to 8GB,
> though...

FreeDOS does work perfectly, it can boot off it and use the entire disk
with FAT32.
--
http://www.munted.org.uk

Fearsome grindings.


Report this thread to moderator Post Follow-up to this message
Old Post
Alex Buell
03-26-08 12:01 AM


Sponsored Links




Last Thread Next Thread Next
Pages (5): [1] 2 3 4 5 »
Search this forum -> 
Post New Thread

A86 Assembler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 01:02 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.