Contents:
IntroductionQUICK INSTRUCTIONS TO TRY THE BOOT-LOADER
Ethernet driver
Download
Quick instructions to try the boot loader
How to install a TFTP server
Tips on the server
How to boot other OSes
Menuet Operating System
How to compile the source code
Forum
These are brief instructions to try the boot-loader. These can be
useful
if you already know a little about TFTP server configuration and Menuet
Operating System.
You must have two computers, the client that will boot MENUET and the
server that will provide the files.
ON THE CLIENT
You must download a small image and put it on a floppy with the RAWRITE utility.ON THE SERVER
This floppy must be putted in the computer you want to boot.
You must have an OS with TCP/IP networking.HOW TO INSTALL THE TFTP SERVER
I advice you to use either LINUX or WINDOWS. I have tried the boot-loader with them and it works fine.
You must have a TFTP server installed. (Not FTP, a TFTP server !).
Your server must have the 192.168.0.1 IP address.
Under LINUX you can use the command
> ifconfig eth0 192.168.0.1
If your server will run under WINDOWS, you have to change the network settings . You have to insert the IP address 192.168.0.1.
The next step is to install two files (img00 and img01) in the root directory.
Under LINUX you will have /img00 and /img01 while under WINDOWS you will have (if you use the C drive) C:\img00 and C:\img01.
img00 is a compiled MENUET kernel with a small modification: that is it has been added a simple jmp instruction to jump the code to load the floppy data. This modification is explained later in this page,so that you can modify your kernel.
img01 is the image of a floppy (the usual mfloppy.img). If you have got already a recent MENUET distribution you can decide to don't download this file. You have to use your mfloppy.img, rename to img01 and put it in the root directory.
Obviously you must connect the server and the client with ethernet.
Now you can try the boot-loader. Put the floppy in the driver of the client and press the RESET button.....
After 1 second, you should see MENUET OS on the client !!!
FOR LINUX USERS
If you are not able to install a TFTP server, try to read these lines. I hope they can help you.FOR WINDOWS USERS
I hope you are already able to do it.
I'm not an expert of networking, but I will try to explain to you.
In your LINUX distribution you can have two different internet deamons:To know which is your deamon you call use this command
- inetd
- xinetd
> ps -ax | grep -i inetd
If you see xinetd, you have got the xinetd deamon.
If you see inetd, you have got the inetd deamon.
I know that the Slackware distribution use inetd, while Mandrake uses xinetd.INETD
If you have a file called inetd.conf in the /etc directory, you have to edit this file.XINETD
To enable the server you have to have the following line:
tftp dgram udp wait nobody /usr/sbin/tcpd in.tftpd
Note that the # character is use for commments !
Now you should kill the inetd with the command
> killall -HUP inetd
and restart it with
> inetd
Now you have got a TFTP server installed on your system.XINETD is a new version of INETD.
There is not only a configuration file as the INETD.
If you have understanded how configuring INETD, you will be able to configuring XINETD with a small effort.
Setup a TFTP server under WINDOWS is very easier than under LINUX.ADDITIONAL ADVICES
Here there is a link to TFTP server. It is a small and simple exe file and it doesn't require any particular installation. To run it you have to launch it at the command line. You have to set the base directory as "C:\", that is the root directory. Then you have to copy the img00 and img01 files on the root directory.
So you will have on the server the files C:\img00 and C:\img01.
I advice you to try to make a TFTP connection with the server by a simple tftp program.DOWNLOAD
In this way you can be sure that the server will send the images.
If it works, probably the boot-loader will work fine.You can make a TFTP connection with
> tftp 192.168.0.1
status
.....
(You can see if there is the connection or not)binary
get img00
get img01
| File | Description | Last update |
| image.zip | Image to copy on the client | 5 Jul 2002 |
| img00.zip | Modified kernel image to copy in the root directory on the server | 10 Feb 2002 |
| img01.zip | An image of the MENUET OS distribution (the usual mfloppy.img
file).
You can decide to don't download this file if you have got already a recent mfloppy.img file. |
10 Feb 2002 |
| src.zip | Source code to make the boot-loader (the image.zip is the compiled image from this source) | 5 Jul 2002 |
HOW TO MODIFY A KERNEL TO BOOT BY RTL8139
At the beginning of the kernel there is the code to read the floppy.
You can delete this code, but I advice you to use a jmp instrucion
to jump that block of code.
In the kernel you see
| (about line 720)
; read_disette to memory mov si,diskload call print ....
(about line 836) readdone:
mov dx,0x3f2
|
You must ADD a jmp instruction.
The new code will be
| ; read_disette to memory
jmp avoid_floppy_reading mov si,diskload
....
(about line 836) readdone:
avoid_floppy_reading:
|
After the modification the kernel must be compiled.
The new compiled kernel must be copied in the root directory with the
name img00
Now the kernel can be booted.
If you use LINUX as server, you can use the MOUNT command to see and
work on the contents of a floppy image.
To do it, you need to enable the LOOP DEVICE in the kernel
configuration.
This is in the menu BLOCK DEVICE.
Then you have to compile the kernel.
Now you can use this ability.
If you have a /img01 (a floppy image 1.44MB large) and an empty
directory /menuet, you can use the command
> mount /img01 -o loop /menuet
Now go in the menuet directory with the command
>cd /menuet
You can see the content of the mfloppy.img image with the ls command.
You can use all the programs you usually use (GCC, NASM, vi,....).
When you have finished (for examaple you have edited a file and then
compiled it) you have to unmount the device with the command
> umount /menuet
Now you have the /img01 that contains the modifications.
With this method you can write a MENUET application and try it (if
it works) with the RTL8139 boot loader.
If you have tried to write your own operating system, you know that
each proof require a lot of time because you have to put the kernel and
other data on a floppy disk, reboot the PC with the floppy disk and
verify
if the changes works fine.
If you have got two computer you can save a lot of time because a PC
run an operating system with all the programming tool (like a C
compiler,
an assembler, a linker, ...) and the other can be used for the reboot
process.
If you have got two ethernet cards you can do better, that is you can
use the ethernet card instead of the floppy disk. The ethernet card can
transmit 1-10 MB/sec, so loading an image of 1.44MB can e done in less
than a second. Loading an entire floppy disk require much more time
instead.
Now I will try to explain the process of ethernet-booting.
Let imagine we have got two PC, PC-A and PC-B, connected by an ethernet
card.
PC-A has got floppy drive that constains a small program. This program
will try to get an image from the PC-B, put it in the RAM and execute
it.
We can use the internet protocol to do it. For example we can use
I have got two PC, both with an ethernet card with the RTL8139 chip,
and the code from an open source project called ETHERBOOT. The target
of
ETHERBOOT is similar to my boot-loader but it has been written to boot
very famous OSes like WINx, Linux, *BSD but the documentation doesn't
explain
how booting a generic kernel-image.
Because of this reason and because I like low-level programming I have
decided to write a simple boot-loader.
Probably you know that the GNU C compiler (GCC) makes 32bit code in
a flat model, that is your application can use a block of memory to
contain
the code and the data. If you are not sure of this, you can write a
simple
C program and then compile it with the -S switch. It tells the compiler
to produce an assembly output, so you can study the generated code.
A great advantage of the flat model is that you don't have got the
classic problem of addressing maximum 64KB data bacuase you can address
a memory cell with 32bit registers.
You cannot use directly a routine compiled by GCC in DOS because DOS
requires that applications must work in real-mode. How is it possible
execute
a routine compiled with the GCC and execute it in DOS ? You have to
insert
a small code 16bit that
I have written the boot loader to simplify the boot process.
In this period I have worked for the MENUET OS (www.menuetos.org).
This is a small OS enterely written is assembly 32 bit and now it has
got
a small libC library, so you can use the GCC compiler to make your
programs.
I hope my boot loader can help to develop both the Menuet kernel and
Menuet
applications.
In this page I have explained how to use te boot loader to load the
MENUET OS.
But it is very easy to modify it to boot some other OSes.
You have only to change some lines in the files rm2pm.asm and
main.c.
In the main.c you have to go to the end of the file.
There is the code
get_file(0x10000);The name of the first file to download is always img00.
.....
writeb('1',request+34)
get_file(0x100000);
writeb('2',request+34)In the rm2pm.asm you have to adjust the address of the jmp instruction.
get_file(<physical address>);
HOW TO COMPILE THE SOURCE CODE
To compile you need DOS (WIN) or LINUX.
The compilers you have to use to compile the source code are GNU C
(C compiler) and NASM (assembler).
FOR DOS (WINDOWS) USERS
To make the floppy you have to insert a floppy in the drive and useFOR LINUX USERS
> make floppy
This floppy will be used for booting the client.
If you peek the make.bat, you can see that there is also the option "dos"
that can be used by the command
> make dos
It is used only for developers and it is used for testing in DOS.
With this option, a COM file is created. This program is useful for testing
if te network works fine.
The option "dos" must not be used for normal users but only for developers.
To make the floppy you have to insert a floppy in the drive and use the script
> ./make-lin
This floppy will be used for booting the client.
There is not an option "dos" as the DOS users.