Article View: alt.lang.asm
Article #357Re: Help about MBR and BOOT sectors
From: Martijn Lievaart
Date: Tue, 14 Jul 1998 00:00
Date: Tue, 14 Jul 1998 00:00
46 lines
3306 bytes
3306 bytes
John S. Fine wrote in message <6odh6g$d5t$1@winter.news.erols.com>... >Patrice SEPULCRE wrote: >> >> I' m writing a MBR program which load the boot sector, >> but I would like to put the partition table to an another sector. >> If I move the partition table and lauch the boot sector program, >> the computer sends an error "insert a system disk with the command.com > > Most OS's reread the partition table for themselves in order to >"mount" disk volumes (including the one they booted from). If the >partition table is not in the expected place and condition then >they fail. > Also any tool that needs the partition table will fail (fdisk comes to mind). Aside from what you state above (which is absolutely correct) I recall that for dos, the dos boot loader expects the mbr to be at a particular place in memory (0x7e00??). On the other hand, I may be completely wrong here. I worked on boot loaders for dosses from 2.2 up to 5.0 but the details are a bit sketchy now. If you like I can send some example mbr's I wrote. > The best solution is DON'T relocate the partition table. What >are you really trying to accomplish? There is probably another >way. > > The method used by many viruses is to hook int 13h and trap all >attempts to read the mbr and return a reconstructed or relocated >mbr instead. There are some non-virus uses for that trick as >well. It won't work with OS's that use pmode drivers for low >level disk access. Another trick is to realise that nowadays all partitions are allocated on cylinder boundaries. Therefore you have the whole of cylinder 0, except sector 0, to store additional code. I haven't really tried this, but I'ld expect it to work. Greetz, Martijn -- #include <stddisclaimer.h> My email address is intentionally invalid agains spam. Please reply to mlievaar at orion in nl
Technical Details
Message-ID:
<6ofql2$2ra$1@winter.news.erols.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6od5ki$its$1@winter.news.erols.com> <6odh6g$d5t$1@winter.news.erols.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102597,98ba2fcc8fb05c45 X-Google-Attributes: gid102597,public X-Google-Thread: 15219e,98ba2fcc8fb05c45 X-Google-Attributes: gid15219e,public X-Google-Thread: f7d8d,98ba2fcc8fb05c45 X-Google-Attributes: gidf7d8d,public X-Google-Thread: feaef,98ba2fcc8fb05c45 X-Google-Attributes: gidfeaef,public X-Google-Thread: f9e32,98ba2fcc8fb05c45 X-Google-Attributes: gidf9e32,public X-Google-Thread: f71eb,98ba2fcc8fb05c45 X-Google-Attributes: gidf71eb,public X-Google-Thread: 102bfa,98ba2fcc8fb05c45 X-Google-Attributes: gid102bfa,public X-Google-Thread: 114917,98ba2fcc8fb05c45 X-Google-Attributes: gid114917,public From: "Martijn Lievaart" <Invalid@against.spam.nl> Subject: Re: Help about MBR and BOOT sectors Date: 1998/07/14 Message-ID: <6ofql2$2ra$1@winter.news.erols.com> X-Deja-AN: 371347866 Approved: <johnfine@erols.com> References: <6od5ki$its$1@winter.news.erols.com> <6odh6g$d5t$1@winter.news.erols.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 X-Mozilla-Status: 0801 X-Complaints-To: abuse@erols.com X-Trace: winter.news.erols.com 900427234 2922 207.172.243.135 (14 Jul 1998 14:40:34 GMT) Organization: EuroNet Internet Newsgroups: alt.lang.asm,alt.msdos.programmer,borland.public.tasm,comp.lang.asm.x86,comp.msdos.programmer,comp.os.msdos.mail-news,comp.os.msdos.misc,fj.binaries.msdos,git.club.asme,microsoft.public.masm