MS-DOS Boot Sector & Boot Programs 
Author Message
 MS-DOS Boot Sector & Boot Programs

Hi all,

Dos anyone have any information on the Boot Sector and Boot programs.

I am planning (hoping) to write a small program that runs before MS Dos is
loaded to check to see if the bootsector is changed as a virus protection
device.

Firstly is this possible using a conventional ASM program and secondly I
would really appreciate it if somebody could Email me with the Bootsector
Information as I don't have FTP access yet.

Thanx for your help in advance.

                                   ACP.
        ????????????????????????????????????????????????????????

        ????????????????????????????????????????????????????????
        3            Happy is he who dares to defend            3
        3      passionately that which he loves. - Ovidius      3
        ????????????????????????????????????????????????????????
        3         Pretty Good Privacy v2.6.i fingerprint        3
        3    56 67 7E 80 85 AC 2C F1  E9 FF 86 83 EC 6E 6D D1   3
        ???????????????????????????????????????????????????????
?



Thu, 25 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

A]> I am planning (hoping) to write a small program that runs before MS Dos is
A]> loaded to check to see if the bootsector is changed as a virus protection

Note almost every bootsector viruse simulates the boot sector to
be unchanged (by installing a TSR _before_ your code gets control).
The thing you can test is free memory size...



Fri, 26 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

Quote:

>    Does anybody happen to know how to "fool" DOS so that
>    it'd skip checking the floppy drive before booting from
>    hard drive?

No doubt that someone will correct me if I'm wrong, but here goes: It's
not DOS doing the checking on the floppy, its the BIOS. This occurs
before DOS is loaded; it is when the BIOS is looking for an operating
system to boot up.

--
=======================================================================

"The difference between theory and practice is a lot bigger in practice
than in theory." -- Peter Van Der Linden.



Sun, 28 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs
        Does anybody happen to know how to "fool" DOS so that
        it'd skip checking the floppy drive before booting from
        hard drive?


Sun, 28 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

: >  Does anybody happen to know how to "fool" DOS so that
: >  it'd skip checking the floppy drive before booting from
: >  hard drive?

: No doubt that someone will correct me if I'm wrong, but here goes: It's
: not DOS doing the checking on the floppy, its the BIOS. This occurs
: before DOS is loaded; it is when the BIOS is looking for an operating
: system to boot up.

That's right. DOS isn't activated until booted from the drive. Modern
BIOSes have an option to set the boot drive to C:. If your BIOS doesn't
support this, you're out of luck.

Arno

--
Arno Schaefer - Technische Hochschule Darmstadt, Fachbereich Informatik

The nice thing about Windows is - It does not just crash, it displays a
dialog box and lets you press 'OK' first.



Mon, 29 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

Quote:

>    Does anybody happen to know how to "fool" DOS so that
>    it'd skip checking the floppy drive before booting from
>    hard drive?

I don't think DOS has anything to do with checking the floppy drives
on boot-up.  It's in the BIOS.  Most CMOS setup programs allow you to
turn this feature off...(ie bypass it).


Mon, 29 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs


Quote:
>> Does anybody happen to know how to "fool" DOS so that
>> it'd skip checking the floppy drive before booting from
>> hard drive?

A> not DOS doing the checking on the floppy, its the BIOS. This occurs
A> before DOS is loaded; it is when the BIOS is looking for an operating

And some BIOS-es allow setup to boot from hard disk w/o checking floppy.



Tue, 30 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

Quote:

>And some BIOS-es allow setup to boot from hard disk w/o checking floppy.

but some disk controllers with their own BIOS ignore that, so if you have one
of those the machine will boot from A: anyhow...

-frisk



Wed, 31 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs
:       Does anybody happen to know how to "fool" DOS so that
:       it'd skip checking the floppy drive before booting from
:       hard drive?
:      

It is the BIOS, not DOS, but if you want to make a floppy boot c:, then
try this. Be very careful, you could end up with a non-bootable system.

debug
l 0 2 0 1
w 0 0 0 1

Copies the C: loader to A:

--
[no.Sig.no.time]



Wed, 31 Dec 1997 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

Quote:

>        Does anybody happen to know how to "fool" DOS so that
>        it'd skip checking the floppy drive before booting from
>        hard drive?

You're not going to get anywhere trying to "fool DOS". Think about it. DOS
isn't loaded yet, so you can't fool it. What you're trying to do is get ROM or
a table that ROM reads to use a different method of loading DOS.

Most motherboards made in the past several years allow you to set a
        *** CMOS parameter ***
which designates the order in which ROM checks disks for the operating
system. On Mine I set it to search "C", then "A". Use the CMOS setup
program, accessible only for a few seconds after Power On Self Test, to set
CMOS parameters.

Need more details? Ask .... or RTFM



Sun, 04 Jan 1998 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs
: I am planning (hoping) to write a small program that runs before MS Dos is
: loaded to check to see if the bootsector is changed as a virus protection
: device.

        I would be able to write some boot code, as it it well known that it
is loaded at 7c00h etc etc, but I don't know how to write something to MBR,
and that code should load, relocate itself, takeover the INT 13h, chain it,
and do some other stuff.  I'm working on a PC personalization package, and I
must overcome this problem.

        Maybe some virus writers (if any of them are reading this) can mail
me with some examples of how it can be done.

        Yes, and that code must remain resident in memory, so loading DOS
(io.sys, msdos.sys) will not destroy it.

--
----------------------------------------------------------
=  Daniel Mosmondor        =   Kolarova 6, 41000 Zagreb  =

----------------------------------------------------------
=  People are ecstatic by their nature  =
-----------------------------------------



Sun, 04 Jan 1998 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

Quote:

>Hi all,

Hi too :-)

Quote:
>Dos anyone have any information on the Boot Sector and Boot programs.

 ^^^
Hmm - Smoked too much DOS again?!?

Quote:
>I am planning (hoping) to write a small program that runs before MS Dos is
>loaded to check to see if the bootsector is changed as a virus protection
>device.
>Firstly is this possible using a conventional ASM program ...

A conventional ASM program won't fit, but if you follow the following
tips, you could be successful (note the word 'could' :-):

1. Your program is always loaded at 0000h:7C00h (if I remember
correctly), so start your source with an ORG 0.

2. Setting up your own stack first could be useful :-)

3. If you wanna code a boot sector program, you gotta let out some
space for the drive parameters before the actual code. But remember:
The execution is still started at offset 0000h, so putting a JMP to
the real code before the drive params wouldn't be a bad idea :-)

4. If you wanna code a replacement for the Master Boot Record (On
HDDs, acually the MBR is loaded and executed by the BIOS. The real
boot sector is then loaded and executed by the MBR (weird eh?)), you
may begin your code directly at offset 00h because there aren't any
drive params required. But be careful not to make your code larger
than 446 bytes, because there has to be some space for the partition
tables at the end of the sector. BTW, the MBR is also loaded to
0000h:7C00h.

5. No matter which of the two you are coding, you should always have
the original BS/MBR saved anywhere on the disk so your proggy can load
and execute the original after having finished its work.

Quote:
>... and secondly I
>would really appreciate it if somebody could Email me with the Bootsector
>Information as I don't have FTP access yet.

No problem (or so :-)!

(derived (NOT copied!) from the book "PC Intern 3.0"/"PC Systems
Programming" by Michael Tischer)

000h-002h: Code (Jump to actual code, eventually filled up to 3 bytes)

003h-00Ah: OEM name (may be anything, e.g. "MY_BOOT!")

00Bh-01Dh: Drive parameters:

  1 Word --> Bytes per sector
  1 Byte --> Sectors per cluster
  1 Word --> Number of reserved sectors
  1 Byte --> Number of FATs
  1 Word --> Number of entrys in the root dir
  1 Word --> Number or sectors in the volume
  1 Byte --> Media-Descriptor
  1 Word --> Number of sectors per FAT
  1 Word --> Number of sectors per track
  1 Word --> Number of R/W-Heads
  1 Word --> Distance between first sector in volume and first sector
in medium.

01Eh-1FFh: actual boot (or whatever) code

Quote:
>Thanx for your help in advance.

You're welcome :-)

Quote:
>                                   ACP.

Joachim Fenkes

P.S.: Don't ever forget: 42 is the answer!!!



Mon, 05 Jan 1998 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs

Quote:

>>        Does anybody happen to know how to "fool" DOS so that
>>        it'd skip checking the floppy drive before booting from
>>        hard drive?

>No doubt that someone will correct me if I'm wrong, but here goes: It's
>not DOS doing the checking on the floppy, its the BIOS. This occurs
>before DOS is loaded; it is when the BIOS is looking for an operating
>system to boot up.
>--
>=======================================================================

>"The difference between theory and practice is a lot bigger in practice
>than in theory." -- Peter Van Der Linden.

You sure?  I thought that it was the CMOS that does that.  Actually,
I'm almost sure of it and if you want to do weird and wonderful things
with the CMOS, check out Ralf Brown (or whoever)'s public Domain
interrupt list, it's got a file detailing everything on the CMOS and
how to access it.


Tue, 06 Jan 1998 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs
Hello again! In my contrib to this theme (20.07.1995) I have written
something incorrect:

Quote:
>1. Your program is always loaded at 0000h:7C00h (if I remember
>correctly), so start your source with an **ORG 0**.

Of course, it mustn't be ORG 0 but ORG 7C00h!!!!!!!!!!!!!!!!
(Yea, I know, I'm an idiot!)

Quote:
>3. If you wanna code a boot sector program, you gotta let out some
>space for the drive parameters before the actual code. But remember:
>The execution is still started at offset **0000h**, so putting a JMP to
>the real code before the drive params wouldn't be a bad idea :-)

The exec is started at 7C00h (of course)!

Quote:
>5. No matter which of the two you are coding, you should always have
>the original BS/MBR saved anywhere on the disk so your proggy can load
>and execute the original after having finished its work.

Hope you have mercy with me :-)))

Joachim Fenkes

P.S.: Don't ever forget: 42 is the answer!!!



Sat, 10 Jan 1998 03:00:00 GMT  
 MS-DOS Boot Sector & Boot Programs
: Hello again! In my contrib to this theme (20.07.1995) I have written
: something incorrect:

: >1. Your program is always loaded at 0000h:7C00h (if I remember
: >correctly), so start your source with an **ORG 0**.

: Of course, it mustn't be ORG 0 but ORG 7C00h!!!!!!!!!!!!!!!!
: (Yea, I know, I'm an idiot!)

No.. that's not completely wrong.  It just takes a  little bit extra to add
07c00 to a particular address, such as-

mov dx,offset message + 07c00h



Sat, 10 Jan 1998 03:00:00 GMT  
 
 [ 19 post ]  Go to page: [1] [2]

 Relevant Pages 

1. MS-DOS boot sector

2. M$DOS 6.2 boot sector

3. Boot sector code to run DOS/Win95

4. Writing at boot sector to the first sector of a disk

5. Boot Sector Program

6. Put a program in the boot sector

7. Boot sector programming

8. Aboout Boot Sector Programming

9. Boot sector programming

10. MS-DOS boot block disassembly

11. Pc Boot Direct:Boot Apps on PC Processor

12. Virus Boot - Boot virus - help

 

 
Powered by phpBB® Forum Software