Copyright (C) 2001 Michael Leonhard Mike Leonhard mike at tamale dot net http://tamale.net/ * Introduction "Because with great wisdom comes great frustration; whoever increases his knowledge merely increases his heartache." - Solomon, Ecclesiastes 1:18 Having thorougly explored the computer systems within my reach, I came to the conclusion that they are all rubbish. The more I learn about them, the more I hate them. Thus, I set out to create a system that is more beautiful and perfect that those which I have studied. I call this system, Sebae. Sebae is a virtual machine. It does not exist physically. It is an abstraction of the fundamental computing device. The construction and use of a computing device involves skills from many fields of expertise. Each of these fields has a concept of the `ideal' computing device. These idealized computers each exhibit a particular elegance when viewed through the paradigms of their respective field. Some of these elegent features are mutually exclusive. Sebae is not meant to be entirely elegant in one area. I have drawn compromises between the ideals in an effort to make Sebae a good balance. These compromises reflect upon my current level of experience and wisdom. * Applications The first useful application for Sebae will be an applet viewer. The viewer will provide an API to the bytecode applet. This API will consist of an event queue, graphics operations, and piped io. Originally the graphics operations will be the SDL API. Later I will add support for OpenGL and possibly remove the SDL API. I will use this applet viewer to explore my ideas about remote application deployment, self-rendering files, and massively multiplayer online games. * Technical Details assembly.txt - Sebae Assembly Language specification bytecode.txt - Bytecode and Virtual Machine specification readme.txt - This file sa.txt - documentation for sa sd.txt - documentation for sd svm.txt - documentation for svm * Projects The three programs in the Sebae distribution share the same Sebae code. svm - the Sebae Virtual Machine sa - the Sebae Assembler sd - the Sebae Disassembler TODO add #ifdef _SEBAE_H_ to header file Decide if API calls should assert() or return -1 fix memory leaks when fcts return -1 CHANGELOG 11-07-01 Fixed faulty ROTATE code 08-31-01 Added byte order conversions to LOAD and SAVE Created Sebae_Module_InstallMagicDefn() Created testmodule Tested and it works!!! 08-30-01 moved build num calculation to sh-compatible script, newbuildnum changed PError() to use the more generic strerror() func now builds and runs in cygwin =) 08-30-01 created module.c and MagicDefnFunc added SebaeDefn.magic Fixed bug where assembly code lacking trailing `;' was not reported Implemented LOADCODE -1 to load gateway defn, the module loader Fixed bug in JUMP where vector was being incorrectly added 08-28-01 Fixed order of parameters, struct SebaeVM *vm is always first Renamed all functions like Sebae_Assembly_WriteFile() 08-28-01 Created mempipe and cleaned up pipe.c Implemented VECTOR, STACKSIZE, STACKHEIGHT, MEMSIZE Implemented LOADCODE Changed vm->mem to type int * LOADCODE WORKS!!!! WOOHOOO!!!! really really really need to address endianness issues 08-28-01 Merged DirectiveSet into InstructionSet, moved to sebae.c Updated sebae.h, assembly.c, and bytecode.c to use new iset Updated Sebae_TicK() with new numbering 08-27-01 Implemented instructions HALT to REMAINDER GAH! glibc is so stupid! I just spent ten minutes trying to find which lib contains fmod() #include but -lm m!?!! !@$)&!&!&$))!!! Implemented instructions FPREMAINDER to XOR Removed NOT instruction Changed ReadAssembly() to start counting line numbers at 1 Implemented instructions ROTATE to SAVE last four unimplemented instructions will print error Fixed iset stack effect for DECIDE Phew... 500 lines added to vm.c today to make the core execute 08-27-01 Created fptest.sa... WORKS GREAT! Changed DestroyVM() to check FreePipe return code Changed FreePipe() to return int Changed api code to check return from FreePipe() Change PrintError() to return 1 Removed calls to PrintError() from API code Added calls to PrintError() to apps Fixed bug in PrintError() 08-26-01 Removed SebaePipe.numpipes. Pipe ids are now reused Added Sebae_PipeBytesToRead() Added int maxheight to SebaeDefn Changed Sebae_Assembly_ProduceNOTIMPLEMENTED() to return an error Commented out debugging printf()s 08-26-01 Changed Makefile to have separate tests Added DATA directive to Sebae_WriteAssemblyFile() Changed VM.c to allow stack and mem sizes of 0 Fixed bug in Sebae_FreePipe() where fd wasn't being reset Created Sebae_WriteDefn() Created Sebae_WriteDefnListLength(),Sebae_WriteBytecode() Created Sebae_WriteBytecodeFile(),Sebae_WriteSignature() Added assert on flen to Sebae_ReadPipe() and Sebae_WritePipe() Added int bytes to struct SebaeDefn 08-25-01 Added Sebae_PipeToFile() and Sebae_WritePipe Changed Sebae_FreePipe() to write uncommitted buffers 08-23-01 Updated bytecode.c to reflect changes in bytecode.txt Created assembly.c, merged files from original sa project Assembly functions now read .sa files into the VM 08-20-01 Removed unneeded #includes created Sebae_PError() checked assert()s in bytecode.c, pipe.c, sebae.c, vm.c moved functions into specific files, bytecode.c, pipe.c, and vm.c 08-18-01 loads and verifies bytecode checks file signature created pipes created error text created svm project