home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / atari / st / tech / 6857 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  2.3 KB

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