MBR

MBR

Post by Joseph David LeBlan » Sun, 22 Jul 2001 04:27:02



does any one know and how to make a MBR, if so how can I make a MBR?
 
 
 

MBR

Post by nos.. » Sun, 22 Jul 2001 04:46:59



Quote:> does any one know and how to make a MBR, if so how can I make a MBR?

What's an MBR?

Massive Ball of Ribbon?
Mucho Big Relleno?
Mexican Bag of Roaches?
Militant Bell Ringer?
Modern Battle Robot?

 
 
 

MBR

Post by Joseph David LeBlan » Sun, 22 Jul 2001 04:48:53


MBR = Master Boot Record




>> does any one know and how to make a MBR, if so how can I make a MBR?

> What's an MBR?

> Massive Ball of Ribbon?
> Mucho Big Relleno?
> Mexican Bag of Roaches?
> Militant Bell Ringer?
> Modern Battle Robot?

 
 
 

MBR

Post by Joseph David LeBlan » Sun, 22 Jul 2001 05:05:51


Im trying to compile my own MBR so I can make a password protected
program for my floppy diskette.




>> does any one know and how to make a MBR, if so how can I make a MBR?

> What do you mean, "make an mbr"?? Every hard drive has a master boot
> record, and the code in the master boot record determines how the hard
> drive boots. Please explain what you want to do in more detail.

> Moshe

 
 
 

MBR

Post by Joseph David LeBlan » Sun, 22 Jul 2001 05:16:31


I like to make a MRB for a floppy drive that I made a C program for. Is
there a way of making a MRB from a C source?




>> Im trying to compile my own MBR so I can make a password protected
>> program for my floppy diskette.

> You'll have to learn how to write in assembly. I don't think this is
> what you want to do. Please provide more details.

> Moshe

 
 
 

MBR

Post by nos.. » Sun, 22 Jul 2001 05:35:55



Quote:> I like to make a MRB for a floppy drive that I made a C program for. Is
> there a way of making a MRB from a C source?

It's been a while, but I'm pretty sure that "Master Boot Record" lives
on the active hard disk partition, not on a floppy.

It sounds like what you want to do is install your own boot image on a
floppy. In that case, you should be able to open the floppy as a raw
device (given whatever special file your system uses), and write the
image to it like any other file.

Creating the image will be the hard part, but I would think you can do
that in C. What OS do you want it to boot? Is there enough room on the
floppy to store the OS and whatever else you want to run?

 
 
 

MBR

Post by Joseph David LeBlan » Sun, 22 Jul 2001 05:45:50


Floppy's does have a MBR, Im not trying to boot a OS, Im trying to make
a password protection program, so if the password is correct then it
updates a regedit document to regedit.exe on windows and maybe make a
little gui to enter the password on.




>> I like to make a MRB for a floppy drive that I made a C program for. Is
>> there a way of making a MRB from a C source?

> It's been a while, but I'm pretty sure that "Master Boot Record" lives
> on the active hard disk partition, not on a floppy.

> It sounds like what you want to do is install your own boot image on a
> floppy. In that case, you should be able to open the floppy as a raw
> device (given whatever special file your system uses), and write the
> image to it like any other file.

> Creating the image will be the hard part, but I would think you can do
> that in C. What OS do you want it to boot? Is there enough room on the
> floppy to store the OS and whatever else you want to run?

 
 
 

MBR

Post by nos.. » Sun, 22 Jul 2001 06:35:17



Quote:> Floppy's does have a MBR, Im not trying to boot a OS, Im trying to
> make a password protection program, so if the password is correct
> then it updates a regedit document to regedit.exe on windows and
> maybe make a little gui to enter the password on.

Well, a master boot record is there to boot an OS with, so if you're
not trying to boot an OS I'm not sure what you're trying to do.

I suspect what you mean is that you want some kind of autostart
capability, such as when you put a CD into the CD Drive and some
program runs automatically.

I can't help you if that's what you want, although there may be some
standard way of doing that, since that sort of thing works in Unix as
well. Perhaps trying a search engine will point you to something
useful.

However, if you're trying to write something that works under
Windows, you might be better off asking this question in a windows
oriented newsgroup, rather than in comp.unix.programmer.

 
 
 

MBR

Post by William Dandret » Sun, 22 Jul 2001 11:44:10


Hi Joseph,

The MBR is 512 bytes long. I am not familiar with the MBR on a floppy but it
must be quite similar to the MBR on a HD.

The last 2 bytes are signature bytes 55AAh. The 64 bytes before that contain
the partition table. The 1st 446 bytes (called boot strap code) contain an
assembly language program that is automatically loaded by the BIOS. It
basically loads itself into memory, does a few checks and the loads OS
booter. There is no room to add any other code.

You cannot create a 446 byte program in C. If you want to be able to
password protect the floppy before booting, take a look at the grub boot
loader. I think you can set it up so that before the system boots it
requires a password.

Bill

>I like to make a MRB for a floppy drive that I made a C program for. Is
>there a way of making a MRB from a C source?




>>> Im trying to compile my own MBR so I can make a password protected
>>> program for my floppy diskette.

>> You'll have to learn how to write in assembly. I don't think this is
>> what you want to do. Please provide more details.

>> Moshe

 
 
 

MBR

Post by Victor Wagn » Sun, 22 Jul 2001 17:21:03



 : MBR = Master Boot Record

I'm affraid that few people in this group know about such thing.
It is strict DOS-ism, and never exist on any machine but PC compatible.

Here there are typically people who program for something better.

You can better ask in some more PC-specific newsgroup, as
comp.os.linux.misc or comp.unix.freebsd.

Really, even in these groups there are few people who actually concern
themselves with _making_ an mbr. It is not a programming task, it is
sysadmin's task

Some utility provided with OS, like fdisk on Linux, knows something
about it, and it is enough.



 :>
 :>> does any one know and how to make a MBR, if so how can I
 make a MBR?
 :>
 :> What's an MBR?
 :>

--
Perl 5 introduced everything else, including the ability to introduce
everything else.

 
 
 

MBR

Post by Victor Wagn » Sun, 22 Jul 2001 17:21:42



: Im trying to compile my own MBR so I can make a password protected
: program for my floppy diskette.

There is no MBR on floppy diskette.

--
Of what you see in books, believe 75%.  Of newspapers, believe 50%.  And of
TV news, believe 25% -- make that 5% if the anchorman wears a blazer.

 
 
 

MBR

Post by Victor Wagn » Sun, 22 Jul 2001 17:46:28



: Floppy's does have a MBR, Im not trying to boot a OS, Im trying to make
: a password protection program, so if the password is correct then it
: updates a regedit document to regedit.exe on windows and maybe make a
: little gui to enter the password on.

Then what it have to do with Unix programming?

First of all, it is unethical thing to restrict users from running your
program. It is a data which must be protected from unauthorized use, not
a code. I can understand programmer seeking a reward for his work,
but various copy-protection schemes typically do more harm for lawful
users than for cracker.

There is a strict negative correlation between quality of program
and amount of effort put into protection from unauthorized use of
program.

For instance, Oracle, one of the best quality closed source products of the
market, not only doesn't use any license manager, but put complete
distribution on there ftp site for trial use.

On other hand, ARC/Info, which is quite popular too, but looks like *
from the point of software design, uses some copy protection technique.

And most elaborate copy protection schemes I've seen are used by some
silly games and reference databases, which I wouldn't count as software
at all.

Concerning your protection scheme, do you really think that some
cracker wouldn't break it just by comparing registry before and
after applying your password program?

And approach you've choose is almost impossbile. Boot sector has
only 512 bytes long, and 48 of them are used as Boot parameter block
which must be there. So, even you write your program in assembly and
count each byte used carefully, there would be no place to fit
filesystem driver in. And you'll need more than one filesystem driver,
becouse there could be Fat16, Fat32, NTFS and NTFS5.

Note that windows NT, booting in resque mode need three diskettes just
to access backup copy of registry and restore it.

It is possible to fit small fullscreen UI (of course not graphical)
into boot sector. I've seen such a boot sectors which displays a kind of
desktop and small dialog box "This diskette is not system Remove it from
floppy and press Ok". Of course, no room was left for actual boot code.

This is possible to fit OS kernel with filesystem driver on the floppy.
In this case you don't need to write a custom boot sector.
You just put there a Linux kernel and initrd image with neccessary program
(it can even might be framebuffer-based GUI), and use some standard
loader (I'll reccommend syslinux) to boot it.

Unfortunately, it wouldn't help in your case, becouse there'is no stable
readwrite NTFS driver for Linux (and any other free Unix as far as I
know). So, your password scheme wouldn't work on NT and Windows 2000.
(which really doesn't matter becouse it is too easy to break).

Don't forget that you'll also need to copy-protect this diskette itself,
and it is almost impossible to make a diskette which would work on any
disk drive around there, but cannot be copied on any of them.
--
<dark> Turns out that grep returns error code 1 when there are no matches.
       I KNEW that.  Why did it take me half an hour?
        -- Seen on #Debian

 
 
 

MBR

Post by Paul Flo » Tue, 24 Jul 2001 18:20:01




> : MBR = Master Boot Record

>I'm affraid that few people in this group know about such thing.
>It is strict DOS-ism, and never exist on any machine but PC compatible.

No, it's a strict PC-ism, but it has no relationship with DOS. If you want
to boot an OS on a PC you must have an MBR, but it doesn't have to be DOS
that wrote the MBR, and it doesn't have to be DOS that you boot.

Quote:>Here there are typically people who program for something better.

>You can better ask in some more PC-specific newsgroup, as
>comp.os.linux.misc or comp.unix.freebsd.

>Really, even in these groups there are few people who actually concern
>themselves with _making_ an mbr. It is not a programming task, it is
>sysadmin's task

Again this is wrong. Someone has to write the MBR code. Though I
don't particularly see any need to write new versions as the
MBRs generated by the various fdisk tools seem to do a good enough
job (with the exception of Solaris x86 fdisk, which should not be
used at all costs!).

Quote:>Some utility provided with OS, like fdisk on Linux, knows something
>about it, and it is enough.

I'd also suggest you make sure that you know your x86 assembler.
The MBR is only one sector (512 bytes, of which 64 bytes are taken by
the partition table, leaving a mere 448 bytes of code).

A bientot
Paul
--
Dr. Paul Floyd       Silvaco Grenoble Research Centre
55, rue Blaise Pascal, ZIRST II, 38330, Montbonnot St. Martin, France
www.silvaco.com      Tel: +33 (0)4 56 38 10 34

 
 
 

MBR

Post by Victor Wagn » Fri, 27 Jul 2001 04:47:38




:> : MBR = Master Boot Record
:>
:>I'm affraid that few people in this group know about such thing.
:>It is strict DOS-ism, and never exist on any machine but PC compatible.

: No, it's a strict PC-ism, but it has no relationship with DOS. If you want

What's a difference? PC is build for DOS in 1980 and since than
all the OSes which can run on PC have to mimic DOS until they get
their kernel or, at least, second stage loader running.

Most of them then happily forget about such strange concept as
partition tables and MBRs and just use normal disklabel within a
thing which looks like partition for other OSes. I think that BSDI 3.1
has an option which allows to not use partition tables at all, if you
are sure that all disk is devoted to this OS.

: to boot an OS on a PC you must have an MBR, but it doesn't have to be DOS

I think that you just have to have some code in first sector of your
drive, which would do The Right Thing, when loaded at address 0x7c00
and run in real mode of x86.  It doesn't ever need to have valid
partition table at the end of sector if you don't want several different
OSes coexist on one disk. DOS conventions are common language for all
PC-based OS-es.

: that wrote the MBR, and it doesn't have to be DOS that you boot.

:>Here there are typically people who program for something better.
:>
:>You can better ask in some more PC-specific newsgroup, as
:>comp.os.linux.misc or comp.unix.freebsd.
:>
:>Really, even in these groups there are few people who actually concern
:>themselves with _making_ an mbr. It is not a programming task, it is
:>sysadmin's task

: Again this is wrong. Someone has to write the MBR code. Though I

I've said FEW people, I've not said NO ONE. Note the difference.
And are you sure that author of Linux fdisk hangs out on c.o.l.d.s?

--
[..]

No I didnt.  Someone else wrote that.  Please keep attributions
straight.
        -- From linux-kernel

 
 
 

1. Questions on MSDOS MBR and FDISK /MBR.

Are all MSDOS MBRs created equal?  That is, on a typical PC harddisks,
and excluding the partition table portion, are the MBRs on hda and hdb
the same?  Are MBRs made with all MSDOS versions the same.

Does "FDISK /MBR" change the partition table part of the MBR?  How
would it know what to change it to?  Defaults? (Horrors!)

If I don't have an MSDOS fdisk program (my DOS has something called
part with no /MBR and which has trashed things before), and I didn't
have LILO make me a backup copy when I installed LILO as the MBR, but
I do have one hanging around from I-don't-know-where-or-when, can I
use it to replace LILO's version?  What else could I do?

Reply to newsgroup only, thanks.

2. rpcbindkeyserv failed eorror while boot !!

3. How to Nuke MBR? (can't use DOS fdisk /mbr)

4. What is going to happend, If I load redhat 5.2???

5. trashed mbr

6. PPP performance test

7. MBR w/ ad01 AND ad1

8. Solaris-8 and firewalling?

9. MBR on notebook got overwritten by lilo. Help!

10. LILO & MBR

11. Removing LILO from MBR

12. MBR ?

13. Read MBR data