1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

power down

Discussion in 'PC Hardware' started by Allan Adler, Oct 19, 2007.

  1. Allan Adler

    Bob Eager Guest

    But what I am saying is that the BIOS doesn't need to know. It can
    always read the boot sector, because it's the same address no matter
    what the geometry. After that, it is not the BIOS's problem.
    Bob Eager, Nov 9, 2007
    1. Advertisements

  2. But as such is part of the filesystem, not the booting process.

    Floppy BPB plays both roles - a) FAT superblock b) geometry values.

    The b) role is probably even more important, and this is why the structure is
    called the _BIOS_ parameter block (and not the "FAT parameter block").

    For hard disk volumes, only a) role is valid.
    Maxim S. Shatskih, Nov 9, 2007
    1. Advertisements

  3. But to access the rest of the diskette, code is executed from the
    No such code is executed. Boot sector is executed only when _booting_ off

    The BIOS firmware - or the OS's floppy block-level driver - reads sector 0 and
    uses the 2 values from it. Nothing more.
    Without 800.com, the PC BIOSes only supported the set of standard floppy
    formats from some enum. With it - arbitrary formats.

    I dunno for now whether the Windows driver is implementing the 800.com
    functionality. Maybe.
    The firmware needs no knowledge of the diskette _to read the first sector_, but
    it needs the knowledge to access the whole media.
    Maxim S. Shatskih, Nov 9, 2007
  4. Allan Adler

    Bob Eager Guest

    I'm sorry, but it does not. The 'firmware' already knows how to read
    from the disk. It is told a track number, a head number, and a sector
    number - and it reads it. The only other knowledge it needs is whether
    the disk is DD, HD or ED - and that information is available without
    reading anything off the disk at all. It needs that information to know
    things such as the data rate to use.

    The boot code read from the diskette, of course, needs to know the kind
    of disk it is on. But that is a separate issue, and the information can
    be stored (explicitly or implicitly) any way it chooses.
    Bob Eager, Nov 9, 2007
  5. number - and it reads it. The only other knowledge it needs is whether

    There were also non-standard formats supported by 800.com
    Maxim S. Shatskih, Nov 9, 2007
  6. Allan Adler

    James Harris Guest

    I think Matt has a point here. You are correct that the diskette
    geometry must be known by some method and that the source on FAT is a
    version of the first few bytes BUT it is not the only source. One
    could encode a boot sector with hard coded values for sectors per
    track and cylinders and NOT store them in the BPB.

    On the other hand I believe it is a good idea to store them in a
    standard format and I wrote my own boot loader in that way. If nothing
    else it means

    a) the floppy can be handled normally in Linux and Windows
    b) Windows will not merrily overwrite it believing it to be 'non-self'
    James Harris, Nov 9, 2007
  7. Allan Adler

    James Harris Guest

    [OT] J (Jonathan?), you really should realise that your posts, rather
    than persuading people to your way of thinking, alienate them. It is
    simply not necessary to be as abrasive or dogmatic as you sometimes
    are. Your knowledge and the information you have is very welcome (at
    least to me) but people don't like being treated as inferior to you.
    Even if you think they are inferior take my word for it that they are
    not. There are some very experienced poeple posting here. It is
    unhealthy if your opinion of yourself is greater than your opinion of
    others here or anywhere else. I don't know how you communicate in
    person - maybe fine - but in writing your tact seems to me to be way
    off. Why not turn down the volume a bit, eh?

    In this instance I think others have well established the point.
    Empirically the case has been made that many IBM compatibles will boot
    from a floppy disk which does not have the magic signature bytes at
    the end. Did you make the point that the signature SHOULD be there to
    conform to the documented format? (Sorry if I misquote you.) That
    seems valid too but it clearly is not required by all PCs. I would,
    however, include it if writing a boot sector.

    FWIW my own boot sector includes jump bytes, BPB, and signature as in
    the following. Hopefully it will meet with your expectations. It is in
    NASM format.

    %define GeometryTableSize (GeometryTableEnd - GeometryTableStart)

    jmp short bstart ;Skip data.

    ;Set up the rest of the Bios Parameter Block (BPB) with default
    ;values for a 1.44Mbyte floppy. Note that the values here are samples
    ;only. The code is designed to work with various values in this table
    ;as long as they are valid and sensible. This table should be
    ;replaced by the one already on the floppy disk when the floppy's
    ;boot sector is replaced by the code that follows.

    ;Note that because we must be 512 bytes in size we will assume that
    ;BPB_BytsPerSec is 512. We also assume and depend on each root
    ;directory entry being 32 bytes in size. Other values are mentioned
    ;here and are used as given on the table which comes from the disk.

    GeometryTableStart equ $
    BS_OEMName db "jashar01"
    BPB_BytsPerSec dw 512
    BPB_SecPerClus db 1
    BPB_RsvdSecCnt dw 1
    BPB_NumFATs db 2
    BPB_RootEntCnt dw 224
    BPB_TotSec16 dw 2880
    BPB_Media db 0xf0
    BPB_FATSz16 dw 9
    BPB_SecPerTrk dw 18
    BPB_NumHeads dw 2
    BPB_HiddSec dd 0
    BPB_TotSec32 dd 0
    BS_DrvNum db 0x00
    BS_Reserved1 db 0
    BS_BootSig db 0x29
    BS_VolID dd 0x12345678
    BS_VolLab db "VOLUMELABEL"
    BS_FilSysType db "FAT12 "
    GeometryTableEnd equ $

    ;;;%if $-btop <> 62
    %if GeometryTableSize <> 59
    %error "Geometry table as defined in this code has the wrong length."

    I included the signature at the end as below. I cannot remember why I
    included the geometry table size. It was so long ago.

    times 509-$+btop db 0 ;Space out to offset 508
    db GeometryTableSize ;Bytes in geometry table
    db 0x55, 0xaa ;Boot sector signature, 55, aa

    .... and hopefully I had the signature order right. It is so often
    shown as AA55 and 55AA one of which is, of course, fine little endian.
    either way as far as booting is concerned.
    James Harris, Nov 9, 2007
  8. Allan Adler

    Bob Eager Guest

    Did you mean Matt, or me?
    Oh, I agree. But it's an interesting discussion!

    I've had problems with Windows even overwriting some of the bytes on the
    'reference disk' for IBM PS/2 machines. These have a magic pattern which
    is used to tell the ROM BIOS to boot from it even if the machine is
    badly misconfigured. Look at the diskette under Windows and those bytes
    are overwritten and the diskette becomes unfit for purpose. I even wrote
    a utility to correct them:


    which is probably more than you wanted to know!
    Bob Eager, Nov 9, 2007
  9. Which three offsets? What pattern?

    Rod Pemberton
    Rod Pemberton, Nov 9, 2007
  10. Allan Adler

    Bob Eager Guest

    Offset 08H, values 20H,33H,79H in that order

    (I had to go and find the source code...!)
    Bob Eager, Nov 9, 2007
  11. Yes, we agree that geometry and size will be ignored for boot,
    BUT BIOS has to figure out what media is inserted, there is no
    indicator in any FloppyDrive. Every BIOS boots fine even if a
    1.44 disk were inserted into a 720-cartridge (as I once used
    for many years as a well working copy-protection).

    The BIOS tries with different speed modes and the controller hardware
    itself checks for a matching "Valid Sector Mark".

    It's all just history now anyway ...
    Wolfgang Kern, Nov 9, 2007
  12. Allan Adler

    Bob Eager Guest

    But there *is* an indicator! The hole in a 3.5 inch disk indicates that
    the disk is not a DD disk; the position of the hole indicates whether it
    is an HD or ED (2.88MB) disk. This information is passed back via pins 2
    and 6 on the interface (6 only for 2.88MB drives, 2 for all). The value
    on pin 2 is passed back in one of the FDC status registers; can't find
    precisely where pin 6 is passed back on a 'normal' PC, but I can on a

    My other question is: why does the ROM BIOS need to know what kind of
    media is inserted anyway? As far as I can see, it needs to know only so
    that it can program the data rate correctly. Is there any other reason?
    Bob Eager, Nov 9, 2007
  13. I dont think you talk about the index mark hole found on 5.25" disks.
    3.5" floppies seems not to be punched at all.
    The information given by the cover of a FD will be ignored by the BIOS
    boot code, otherwise my copy-protection would never have worked.
    Many time passed since I worked on FD controller setup code,
    so I really don't remember enough to confirm this details yet.

    You can Search our AOD-cyberscriptorium for:
    "Programming the NEC µPD765 and Intel 82072-7 Floppy Disk Controller.htm"
    or with Debby's comments:
    Only one more reason: to SET or not to SET the MFM-bit.
    Disassemble your BIOS code and see how and what the BIOS does during boot,
    all my oldies did it by set 'speed/mode and try' loops.

    Wolfgang Kern, Nov 10, 2007
  14. Ah, cool. Thanks.
    Ciaran Keating, Nov 10, 2007
  15. Allan Adler

    Bob Eager Guest

    I have my own, similar, reference information including details of the
    But it needs to do that *before* it reads the boot sector. So, I repeat,
    it may be nice for it to know, but there is no actual reason.
    Bob Eager, Nov 10, 2007
  16. Allan Adler

    Bob Eager Guest

    How does it manage this if the diskette is unformatted? Just a thought.
    Bob Eager, Nov 10, 2007
  17. I'm not sure if this summary is completely correct. And, I'm unsure what
    standards to try to locate. But, it might help clarify which holes. Memory
    fades on the 5 1/2. I'm not too familiar with the 5 1/2 HD or 3 1/4 ED...
    And, trying to find info without pulling up copies of Wikipedia's article on
    floppies is problematic. I oriented the info with the write protect switch
    in the top right because that's how I look at the disk, but everything I'm
    finding online seems to be doing it with the protect at the bottom left.

    5 1/2 (SD/DD/HD)
    - right side notch - open writable
    - no left side notch - SD or DD
    - left side notch - open HD
    - timing index hole

    3 1/4 (DD/HD/ED)
    - right side hole - closed writable
    - no left side hole - DD capacity
    - left side hole (in line with right) - HD capacity
    - offset left side hole (below other left hole) - ED capacity

    There's a picture here of an 3 1/4 ED disk with the offset ED hole (open or
    white background).

    Rod Pemberton
    Rod Pemberton, Nov 10, 2007
  18. Last three char's of the oem name (DOS BPB) have to be "<sp>3y"? That's
    kinda wierd...

    Rod Pemberton
    Rod Pemberton, Nov 10, 2007
  19. Allan Adler

    Bob Eager Guest

    That's right. I actually have samples of all of those (and an 8 inch
    one!)...I have machines with ED drives...!
    Bob Eager, Nov 10, 2007
  20. Allan Adler

    Bob Eager Guest

    Yup. No idea how they chose those.
    Bob Eager, Nov 10, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.