|
Mavos Demos These demos will run on Intel 386 compatible processors, such as the Intel Pentium I, MMX, II, III, IV and Pro.Basic Demo The following demonstration runs diagnostic tests that illustrate numerous features of the virtual machine and underlying operating system.
Download demo1 Instructions Step 1. Write the bootloader psBoot.bin to the boot sector of a floppy disk. In Windows you may use the "debug" command. The debug command's disk write option has the following format: debug -w offset drive track sectors By executing the following, debug psBoot.bin you will load the file to memory at offset 0x100 (no segment address required), and write a single sector (512 bytes) to the sector 0 of the a: drive. Be careful in using the debug command that you do not write to your hard drive. Using a text file as input to the program is a safe way to do so. You may use the batch file debugCmd.bat and its input file debugCmdIn.txt if you wish. Step 2. Copy the operating system binary image demo1.bin to the floppy using a normal file copy. It should be the only file on the floppy disk. Step 3. Reboot your PC with the floppy inserted in the a: drive. You should see the operating system load itself and run various diagnostic tests. The source for these tests is the file Test.java which contains the class test.Test and numerous inner classes. With the next demonstration you will be able to write your own java code to run on the system.
Advanced Demo
This demo allows you to run your own java code on Mavos. You require Microsoft Visual Studio 6 or higher or a similar C compiler, and you must have a java compiler such as the one provided with the Java 2 Platform Standard Edition (J2SE) from Sun Microsystems.
Download demo2 Instructions Step 1. Write your own java class "test.Test". The system will attempt to locate the method "void main(String[])" in this class as the entry point. You may include as many classes as you wish, although the bootloader will load up to a limit of 384 kb of data, so the final disk image must be under that size. A typical disk image size is around 230 kb. Step 2. Use your java compiler to compile your code. Note that the java code must be CLDC J2ME compliant, which means that if you use any of the J2SE API not present in J2ME CLDC and not supported by the system then an error will be thrown. |
|||
|
Step 3. Use the encode utility to generate a source code file that will be included with the Visual Studio project. The command line is: encode.exe listing.txt outputFile.c [-classpath dir1;dir2;...] The file listing.txt must contain a listing of all the java class files you wish to include, which will be the file test/Test.class and any additional files you have compiled (which must include compiler generated class files for inner classes). You may specify a classpath to help the utility locate your files, otherwise it will search from the current directory. There is an example of listing.txt provided, one that can be used with the java source from Demo 1. Note that the utility will search for the class based on its package name (as is the usual case with Java), so the "test.Test" class file must be situated in a directory named "test". Step 4. Open the Visual Studio workspace demo.dsw. Your C source file must replace the file unlinkedStaticClassFiles.c in the Visual Studio project. Select the file unlinkedStaticClassFiles.c in the workspace window and hit the delete key, and add your source file with the "Add to Project" menu listing under the "Project" menu option. Or simply replace the text in the unlinkedStaticClassFiles.c file with the text in your source file. The file unlinkedStaticClassFiles.c is a source file produced from the java code used in the above demonstration and can be used as a reference. Step 5. Build the project to produce a Windows executable demo.exe using the Build menu option. The build process will compile your C source file into an object source file and link with the files psEntry.obj and lib.lib. The project options are set to link an executable with a 0x0 base address. However, this linker always relocates the code 0x1000 bytes above the specified based address, putting the code at 0x1000. The bootloader takes this address into account by loading the code at address 0x1000 instead of 0x0. Ignore any warnings that the base value of 0x0 is invalid for a Windows executable. Step 6. Run the ExeToBin utility on the generated executable to generate a new operating system binary image. The command line is: ExeToBin.exe demo.exe demo2.bin Step 7. Complete all 3 steps of demo 1 with your new binary system image demo2.bin and the bootloader binary image psBoot.bin. The system will load itself, jump into your java code and begin executing.
The system is configured with the following options: growable java thread stacks, a heap size of 1 MB, and garbage collection that will run when all of your threads go idle. | |||
|
| |||










