User’s Manual
(DEX-OS 1.0 March 5, 2004)

1.	Introduction

1.1	System Requirements
The following minimum hardware requirements should be met in order to boot DEX-OS:
1.1.1	At least 8MB or RAM
1.1.2	A 386 or better CPU, Pentium or better is highly recommended
1.1.3	A color screen (CGA at least, a VGA adapter is highly recommended)
1.1.4	A 1.44MB floppy disk drive

1.2	Software Requirements
The following software might be required if you are planning to develop applications or modify the kernel:
1.2.1	Microsoft Windows 95/98/ME/XP operating system
1.2.2	DJGPP 2.03 C compiler for compiling the kernel
1.2.3	BloodShed DEV-C++ 5.0 or MinGW compiler for developing applications/ drivers
1.2.4	nasm 0.98.36 assembler for compiling the kernel .asm(assembly) files

1.3	Description
DEX is an operating system specifically designed for educational and research use. The DEX Operating system allows for the dynamic reconfiguration and customization of various system services using concepts found in extensible operating systems. Additionally it aims to create an operating system design that would be easy to understand while having features that are common with today’s modern operating systems. Unlike other small operating systems, DEX-OS is powerful enough to support simple applications that require multithreading and file management. Its architectural design, with the help of Aspect-Oriented programming, enables for easy modification and extensibility. DEX-OS was developed in C and runs on PCs with 80386 processors or higher

1.4	License
DEX-OS is released under the terms and conditions of the GNU General Public License (GPL) version 2. A copy of the GPL is included with the operating system or you may obtain a copy from Free Software Foundation at 675 Mass Ave, Cambridge, MA 02139, USA. Software applications included with the operating system that are not written by the author use their own respective licenses.
 

2.	Installing DEX-OS

2.1 Installing from a floppy
2.1.1	First, you must be able to boot DEX-OS. To do this, insert the DEX-OS floppy disk into the floppy disk drive.  
2.1.2	Restart the computer and wait for the computer to boot from the floppy disk. If it does not, you may need to adjust the BIOS to boot from the floppy, consult your computer’s users manual for this.
2.1.3	Once the computer boots from the floppy, you will see the GRUB bootloader startup menu. Simply press enter to continue.

 

2.1.4	Wait for the startup process to finish. Once you see the command prompt type the following to the command line:

copy /boot/dexinst.bat /ramdisk
run /ramdisk/dexinst.bat

2.1.5	This command will run the script file dexinst.bat which will install the operating system to another floppy. Simply follow the instructions generated by the program.

2.2	Installing from source (MS Windows)

2.2.1	You must have already installed a working copy of DJGPP 2.03 or higher as well as NASM 0.98 +.

2.2.2	Extract the Zip file dex-os_bx.zip (where x may be a number depending on the version) to a convenient location although it is recommended that you unzip it to a directory under \bin where \bin is the directory where gcc.exe is located.

2.2.3	Then run the batch file make.bat like this (assuming c:\gcc\bin is the location of your gcc compiler and c:\nasm is the location of nasmw.exe):

make c:\gcc\bin c:\nasm

2.2.4	The output of the previous step should be kernel32.bin which is the binary file of the DEX kernel.

2.2.5	For the next step, you should now install the GRUB bootloader onto a blank floppy disk. In order to this you must first obtain the stage1 and stage2 files from the GRUB distribution (should be provided with the DEX distribution package) and another blank floppy disk (which will serve as the GRUB installer). 

2.2.6	To create the DEX boot disk type the following commands on the command prompt (assuming stage1, stage2 and kernel32.bin is in your current directory):

mkdir a:\boot
mkdir a:\boot\grub
copy stage1 a:\boot\grub
copy stage2 a:\boot\grub
copy kernel32.bin a:\

Then create the following file with the ASCII text editor of your choice: 

# Entry 0:
        		title   DEX 1.00SP Operating System
        		root    (fd0)
kernel  /kernel32.bin

Then save it as a:\boot\grub\menu.lst


2.2.7	Although the DEX boot disk now has all the files it needs to boot, it will still not boot since the floppy disk itself is still not bootable. Next we will create the GRUB installer disk, in order to do this type the following commands:

copy stage1+stage2 grub.bin

Then use a floppy disk utility like rawwrite.exe (Provided with the package) to copy the file grub.bin to the boot sector of the GRUB installer floppy disk.
2.2.8	Then restart your computer and boot using the GRUB floppy disk. After GRUB has started, you should see a command prompt. Then remove the GRUB installer floppy disk and insert the DEX boot disk. At this command prompt type:

> setup (fd0)

This command will place the stage1 and stage2 at the appropriate places in the floppy disk and make it bootable. Then restart your computer to start using DEX-OS.

2.3	Installing from the disk image

2.3.1	This is by far the easiest of all the steps, simply obtain a copy of the disk image dex-os-beta.img  and then insert a blank floppy disk into the disk drive and then use rawwrite.exe to write the image directly onto the floppy disk. The floppy disk should now be bootable and it even contains sample applications that you could use!
 




 

3.	Basic Console Commands

3.1	The DEX-OS directory structure: Navigating your way around.

Similar to UNIX and MS-DOS, files in DEX-OS are located in directories and subdirectories. The root directory is located at “/” and it should be the current directory after startup. The main commands that are useful for navigating include the cd and ls commands.

To list the files in the current directory type “ls” at the command prompt like this (The “/%” character is part of the command prompt and should not be typed):

/% ls –l

A screen similar to the one below should appear: 
 
		    Fig 2. The result of an ls command	

	The ls command automatically sorts the list in alphabetical order, you may also sort the list based on size by using the –osize parameter.

3.1.1 Changing directories
	To change directories, use the cd command, the format of the cd command is similar to the ones UNIX-like operating systems use and has the following form:   cd <directory name>
Examples:
cd boot
cd ..
cd .
cd /boot/prog

Remember also that the / in front of a directory name has a meaning, therefore the commands cd prog and cd /prog has a different meaning. The former refers to a subdirectory in the current directory and the latter refers to a directory named prog under the root directory. To determine the current directory, you may look at the prompt or simply type cd with no parameters at the command line

3.1.2	Mounting and Unmounting Drives

Like other UNIX-like operating systems, you must also “mount” your drives so that you could see the files stored on them. On startup, DEX automatically mounts the floppy disk drive to /boot. You can tell if a device is mounted on a directory through its color, mounted directories has a blue color. The format of the mount command is as follows:
		
		mount <filesystem> <device name> <mount directory name>

	Likewise, in order to remove a device (especially the floppy) or to swap devices, you must first unmount them. The unmount command is of the following form:

unmount <mount directory name>

Example: 

To use a new diskette, you type the following commands:

/% umount /boot

<insert new diskette here>

/% mount fat floppy boot

Likewise, to unmount the device, type:

/% umount boot

3.1.3	Running Programs and Loading Modules

To run a program and it is in the current directory, simply type its name (including the .exe). If the program is in another directory, you must include its full path name, for example if dexedit.exe is in the /boot directory you must type /boot/dexedit.exe to run it.

To load a library or device driver module, you use the loadmod command. For example, to load msvcrt.dll to memory you type:

loadmod msvcrt.dll

Additionally, if you want to view the modules loaded into memory, you use the lsmod command. 


Note: Under extreme circumstances, you may wish to force terminate a running program. To do this hold CTRL and ALT and then press F4. Any data that you were working on that program might be lost. Alternately, you may also use the kill command by typing at the command prompt:

Kill <name of process> 

Or

Kill <process ID>

	
3.2	File Operations

Here is a summary of the commands related to files (You may also type help at the command prompt to view details on  them):

copy <source file> <destination directory or file> 
del <file>
rmdir <directory name>
ren <old filename> <new filename>
mkdir <directory name>

3.3	Managing Virtual Consoles

DEX is capable of creating multiple consoles at once, which enable you to many programs and switch from one program to another. To create a new console, hold CTRL and ALT the press F2, you should see the screen clear and a new prompt appears. To switch back to the previous console hold CTRL and ALT, then press F5 or F6, you may also press ALT + TAB to show the foreground manager console. In the foreground manager console, you may use the up and down arrows to pick the virtual console session you wish to activate and then press enter.

3.4	Loading and using ramdisks

Ramdisks are very fast block devices that exist in memory and is primarily used for placing files that are accessed quite often. If you have created the DEX-OS boot disk using the floppy image, you should already have a ramdisk installed and mounted at /ramdisk. If you want another one, use loadmod command to install another ramdisk into memory, but you must specify a new device name using the –n parameter:
		
		/boot/ % loadmod ramdisk.dll –n ramdisk2 
			
	This loads ramdisk.dll (Which contains the program for the ramdisk) and gives it a device name of ramdisk2. Then mount the device so that DEX will add it to the filesystem:

		/boot/ % mount fat ramdisk2 /mydir 

	This instructs DEX to mount ramdisk2 using the FAT filesystem at /mydir. At this point any files you copy to /mydir will be correspondingly be copied to ramdisk2.

 
4.	Summary of Console Commands
Command	Syntax	Description
cat	<filename>	Displays the contents of filename
cd	<directory name>	Change the current directory to <directory name>
cls		clears the current console screen
copy	<source> <destination>	Copy a file from source to destination
cupid		Displays cpuid information
del 	<filename>	Deletes <filename>
dir		Displays the contents of the current directory
echo	[message]	Prints message to the screen
exit		Terminates current console session
files		Displays all open files
find	<filename>	Shows the full path o <filename>
help		Types /boot/dexhelp.txt
kill	<pid/process name>	Forcibly terminate a process
libinfo	<module name>	Lists the exported functions of a module
loadmod	<filename>	Loads a library or device driver into memory
ls	[-l][-osize][-oname]	Displays the contents of the current directory
lsdev		Lists the devices installed in the system
lsext		Lists the extensions currently used by DEX
lsmod		Displays the modules currently installed in memory
lspcut		Displays the list of pathcuts or "aliases"
mem		Displays page allocation information
meminfo		Displays memory map provided by grub
mkdir	<directory name>	Creates a directory
mount	<filesystem> <device> <mount name>	Mounts a device using <filesystem> at <mount name>
newconsole		Instantiates a new console session
path		Displays the current path
pause		Pause and wait for a keypress
pcut	<alias> [full path]	Aliases a path
procinfo	<process id>	Displays information about a process
ps		Displays the process list
rempcut	<alias> 	Removes a path cut or "alias"
ren	<olname> <newname>	Renames a file
Rmdir	<dirname>	Deletes a directory and all its contents
run	<script filename>	Runs a script file
set		Sets an environment
time		Displays the current time
type	<filename>	Shows the contents of <filename>
umount	<mount name>	Unmounts a device
unload	<module name>	Removes a module from memory
use	<device name>	Replaces an extension used by DEX
ver		Displays the operating system version
