From: Bart Oldeman <bartoldeman@users.sourceforge.net>
To: Frantisek Rysanek <Frantisek.Rysanek@post.cz>
Cc: linux-msdos@vger.kernel.org
Subject: Re: Linux vs. DOSEMU geometry (Was: Re: DosEMU, Ghost: VGA screen garbled...)
Date: Thu, 24 Sep 2009 11:42:33 -0400 [thread overview]
Message-ID: <c3d607cc0909240842h3fbc2350j9de568656db10577@mail.gmail.com> (raw)
In-Reply-To: <4AB6A719.5304.328F1D@Frantisek.Rysanek.post.cz>
On Sun, Sep 20, 2009 at 4:05 PM, Frantisek Rysanek
<Frantisek.Rysanek@post.cz> wrote:
> On 18 Sep 2009 at 18:00, Bart Oldeman wrote:
>> In fact HDIO_GETGEO gives bogus info so I changed it
>> to look at the MBR as well to determine CHS limits.
>> It's now in SVN.
>>
> you mean completely bogus?
Well it may not be completely bogus as you explained -- however things
have changed in the Linux kernel too. particularly from 2.4 to 2.6.
And I could not find anywhere where the kernel parses the MBR to find
CHS values though fdisk certainly tries.
I have a 4G USB key that I used to test "wholedisk" with a
preformatted geometry (as I could see in the DOS boot sector) of
CHS=978/128/63; however HDIO_GETGEO reported CHS=1017/125/62. This
value was invented by setsize() in the Linux kernel's
drivers/scsi/scsicam.c. Similarly, there's ata_std_bios_param() in
drivers/ata/libata-scsi.c which invents xxx/255/63 (the standard
values used for large hard disks nowadays).
Linux fdisk even says 5922/37/36 because it parses the MBR, assuming
that the partition ends at a cylinder boundary (it does not; the MBR
is
Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 80 0 9 0 36 36 978 8 7888888 0b
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00
so it stops a little before the boundary).
All I wanted in DOSEMU was some kind of geometry that agrees with the
MBR so DOS can make sense of it (and FreeDOS boots without warnings).
And an "S" value of 63 is very common so I put some code there to
check whether that values makes sense.
Of course in reality for modern OSes CHS is irrelevant but the older
DOSes that also may get used in DOSEMU such as MSDOS 6.22 only use
CHS.
Bart
next prev parent reply other threads:[~2009-09-24 15:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-14 22:47 DosEMU, Ghost: VGA screen garbled Frantisek Rysanek
2009-09-15 6:46 ` Frantisek Hanzlik
2009-09-15 7:41 ` Frantisek Rysanek
2009-09-15 11:53 ` Richard
2009-09-17 9:06 ` Frantisek Rysanek
2009-09-18 16:00 ` Bart Oldeman
2009-09-18 19:11 ` Alain Mouette
2009-09-20 20:25 ` DOSEMU VGA graphics on a FrameBuffer (Was: Re: DosEMU, Ghost: VGA screen garbled...) Frantisek Rysanek
2009-09-21 18:58 ` Alain Mouette
2009-09-20 20:05 ` Linux vs. DOSEMU geometry " Frantisek Rysanek
2009-09-24 15:42 ` Bart Oldeman [this message]
2009-10-05 21:52 ` Frantisek Rysanek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c3d607cc0909240842h3fbc2350j9de568656db10577@mail.gmail.com \
--to=bartoldeman@users.sourceforge.net \
--cc=Frantisek.Rysanek@post.cz \
--cc=linux-msdos@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox