Orkie said:
It looks nice. Do you have any libraries/drivers with it or is all the hardware access handled by the individual game?
Thanks.
The user programs load all the built in functions using a int 40h, which load the address into a call-table.
Example of basic DexOS program:
CODE
;=========================================================;
; asm2 01/05/06;
;---------------------------------------------------------;
; By Dex. ;
; ;
; Here is a basic DexOS program. ;
; Just prints a message and returns. ;
; To assemble use fasm as follows ;
; A:\fasm asm2.asm asm2.dex ;
;=========================================================;
use32 ; we want 32bit addressing
ORG 0x400000 ; where our program is loaded to
jmp start ; jump to the start of program.
db 'DEX1' ; DexOS checks for this, to make shore it a valid DexOS file.
msg1: db 'Hello world! ',13,0; String to print.
;----------------------------------------------------;
; Start of program. ;
;----------------------------------------------------;
start:
mov ax,18h ; load ax with the nonlinear data desetor
mov ds,ax ; move it into DS and ES
mov es,ax ; as you can not move it directly.
;----------------------------------------------------;
; Get calltable address. ;
;----------------------------------------------------;
mov edi,Functions; this is the interrupt
mov al,0 ; we use to load the Dex.inc
mov ah,0x0a ; with the address to DexOS functions.
int 40h ; int 40h = to Dos int 21h.
;----------------------------------------------------;
; Exit. ;
;----------------------------------------------------;
mov esi,msg1 ; this point's to our string.
call [PrintString]; this call the print function.
call [WaitForKeyPress]; is the wait for keypress function.
ret ; This returns to the CLI/GUI
;----------------------------------------------------;
; Data. ;
;----------------------------------------------------;
include 'Dex.inc' ; Here is where we include our "Dex.inc" file
The "Dex.inc" is layed out like this:
CODE
Functions:
CallTableAddress rd 1 ; 0.call-table address,DO NOT call as function.
Clstext rd 1 ; 1.Clears text mode screen, but leaves top 4 rows uncleared.
RealModeInt10h rd 1 ; 2.Call realmode int 10h,fill in AX,BX,CX,DX, with function number etc, be carefull may not work will all functions.
RealModeRegs rd 1 ; 3.Fills in AX,BX,CX,DX with result from above function,set CF to 1 on error.
WaitForKeyPress rd 1 ; 4.Wait for keypress,Exit: ASCII code of keypressed in AL .
KeyPressedNoWait rd 1 ; 5.If keyperssed AL=1,if no keypressed AL=0.
ExtendedMemory rd 1 ; 6.puts extended memory in eax (in KBs),puts total ram in ebx (in MB)
ConvenMemorySize rd 1 ; 7.puts conventional memory in eax (in KBs)
TextColor rd 1 ; 8.Sets the text color, Entry: AL=color.
PrintString rd 1 ; 9.prints a string,esi should point to a 0 termanated string.
PrintChar rd 1 ; 10.prints the char,in al
PrintCharCursor rd 1 ; 11.prints the char,in al and moves cursor
SetCursorPos rd 1 ; 12.Sets Cursor Pos, Entry: AL=X, AH=Y, if the X or Y is bigger than screen size, CF to 1, succes AH=0.
; LOT MORE FUNCTIONS ARE HERE:
Once the call-table is load, you just call the function, by filling regs with the right number (if needed) and calling the function
Print string example:
CODE
mov esi,string ;points to string
call [PrintString] ;call function
;some more code here
string: db "hello world!",0
NOTE: The name of function is in [ ] as we are calling the address in the var, not var its self.
Theres also load able module for drivers, which can be call by calling the module function along with its ID, which if load will return alink address in to a list of function in that module or error if not loaded.
You can also use lib in the form of .inc files or call the function with int 40h and function number.
The OS include's a full TCP/IP stack and can be use as a web server etc, if you have the right ethernet card, only RTL8139 ethernet card driver is written so far.
It's also got a fasm and FasmArm port.
I hope to port most of this to GP2X
.