Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdahl!amdcad!philip From: philip@amdcad.AMD.COM (Philip Freidin) Newsgroups: comp.sys.ibm.pc Subject: Re: Boot sector of harddisk? Keywords: where is it? Message-ID: <23862@amdcad.AMD.COM> Date: 26 Dec 88 05:28:51 GMT References: <6941@xanth.cs.odu.edu> Reply-To: philip@amdcad.UUCP (Philip Freidin) Distribution: na Organization: Advanced Micro Devices Lines: 56 In article <6941@xanth.cs.odu.edu> kahn@xanth.cs.odu.edu (Gary I Kahn) writes: >The boot sector on a floppy disk is at head 0, track 0, sector 1. >Can someone tell me where the corresponding sector is on a hard disk? >I'm trying to locate the bytes on the disk which give information about >the number of sectors, heads, and tracks. I tried using INT 13 to read >the sector mentioned above (0/0/1), but it turned out to not be the >boot sector. The disk-editor utilities I tried use logical sector numbers, >not tracks and heads. Thanks in advance. Since I did this half an hour ago, it is still fresh in my little mind: assume you want to look at drive C, (drives are numbered from 0 (A), 1 (B), 2 (C). you want the first sector of the hard drive (512 bytes). go into debug (the worlds best word processing editor), and look at the value of CS. This is where you will have some free room. C:>debug rcs CS 4532 : Dont type anything, just return L 4532:0 2 0 1 load at the specified address (4532:0 you got this number from the rcs enquiry) from drive 2 (you got this from me, assuming you want drive C), starting at sector 0, for 1 sector(s). d 4532:0 l 200 there is the boot sector. first 3 bytes are a jump to the boot code. the next 20 or so bytes are the drive format descriptor table you are looking for. n bootblk.bin get ready to write it out as separate file rbx BX ???? :0000 set BX to 0 rcx CX ???? :0200 set up to write out 512 bytes w 4532:0 write the boot block (512 bytes) to a file called botblk.bin And there you have it. lots of fun. Philip Freidin @ AMD SUNYVALE on {favorite path!amdcad!philip) Section Manager of Product Planning for Microprogrammable Processors (you know.... all that 2900 stuff...) "We Plan Products; not lunches" (a quote from a group that has been standing around for an hour trying to decide where to go for lunch) Turns out, we can't even plan products.