home *** CD-ROM | disk | FTP | other *** search
- From: clausb@hpbbrd.bbn.hp.com (Claus Brod)
- Date: Mon, 25 Jan 1993 17:40:01 GMT
- Subject: Re: Reading BIOS Boot Parameter Block
- Message-ID: <C1F7qs.DCA@hpbbrd.bbn.hp.com>
- Organization: HP Mechanical Design Division
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpcc05!hpbbn!hpbbrd!clausb
- Newsgroups: comp.sys.atari.st.tech
- References: <1993Jan25.091437.1835@unix.brighton.ac.uk>
- X-Newsreader: TIN [version 1.1.8 PL6]
- Lines: 47
-
- Lost Boy (mm68@unix.brighton.ac.uk) wrote:
- > Can anyone tell me how to read in the BIOS boot sector paramter from a floppy
- > disk and how to access the value of it in C? I am having loads of trouble,
- > getting spurious data, or hang-ups!
-
- In Pure C/Turbo C, you just say:
-
- #include <tos.h>
-
- [...]
-
- BPB mybpb, *bpbptr = Getbpb(drive);
- if (bpbptr)
- {
- memcpy(&mybpb, mybpbptr, sizeof(BPB);
- /* read the values in mybpb */
- }
-
- 'drive' is a BIOS drive number, and BPB is a structure declared in <tos.h>;
- the name of the include file and the names of the structure elements
- might vary depending on the compiler you're using.
-
- Note that it's possible that the system reuses the space that 'bpbptr'
- points to when Getbpb() is called for the next time, so it's not
- safe to assume that every drive has a dedicated BPB somewhere in the
- system. I know of at least one version of AHDI that allocated only
- one BPB and filled it with values whenever Getbpb() was called
- for a drive on a hard disk. That's why the code fragment above
- immediately copies the BPB to a safe place. This won't help,
- however, in a multi-tasking environment where taskswitches could
- occur between the Getbpb() and memcpy() calls. I think this old
- AHDI's behaviour in this respect is unsafe. I don't know about
- current AHDI versions, though.
-
- > Also, I have written a formatter which uses interleaving (factor 11) but
- > when i use Quikdex I get a performance drop to 48% from the usual 97%!!!
- > Any idea what I am doing wrong?
-
- A generally good advice on QuickIndex' disk throughput values might
- be to ignore them and write your own tests 8-), but in this
- case you've probably spotted a real problem in your program.
- Are we talking 9- or 10-sector formats here?
-
- --
- --clausb@hpbeo79.bbn.hp.com----------------------------------------------
- Claus Brod, MDD, HP Boeblingen Things. Take. Time. (Piet Hein)
- --#include <std_disclaimer>----------------------------------------------
-