DEBUGOS v0.03 - Tiny debug like Operating System for x86

3.Sep.2004 by ATV, Finland       email: askovuori@hotmail.com


##########################################################
#               Install DebugOS                          #
##########################################################
Read this file!
Put empty floppy in drive A: and run install.bat
Then you can reboot computer.


##########################################################
#               DebugOS commands                         #
##########################################################
  dump  -D start
  enter -E ofs byte "txt"
  fill  -F start end byte
  go    -G ofs
        Note: program MUST end with retf (=CB in hex)
        or int 81h/ah=0 (tsr with int 81h/ah=1)
  move  -M start end dest
  load  -L ofs sectorno
  write -W ofs sectorno
  help  -?

Notes:
* all numbers in hex


##########################################################
#               Sectors on 1.44M floppy                  #
##########################################################
  0         = DebugOS binary
  1         = DebugOS help message
  2         = tsrclock
  3         = tsrcalc
  4         = edit
  5         = tetris
  6 - 2879  = free


##########################################################
#               DebugOS functions                        #
##########################################################
DebugOS int 81h function numbers in ah
  00 - Exit         ;Terminate program
  01 - TsrExit      ;Terminate TSR program
  02 - ReadDisk     ;Read 1 sector from disk
  03 - WriteDisk    ;Write 1 sector to disk
  04 - InChar       ;Get user keypress
  05 - OutChar      ;Write char
  06 - InStr        ;Get user line input
  07 - OutStr       ;Write ASCIIZ string
  08 - NewLine      ;Print new line


##########################################################
#               TSRCLOCK                                 #
##########################################################
Install tsrclock:
  -l0 2
  -g0

Uninstall:
  -l0 2
  -g0

Notes:
* memory can be set free only if tsr is just before running program


##########################################################
#               TSRCALC                                  #
##########################################################
Install tsrcalc:
  -l0 3
  -g0

Press F2 to activate tsrcalc

Uninstall:
  -l0 3
  -g0

Notes:
* memory can be set free only if tsr is just before running program
* big numbers can overflow ex. 65536*32768 because there is only
  31 bits for result (and one bit for sign)
* number range: -2G..2G or $0..$FFFFFFFF
* second number base are used for output
* operators: +, -, *, /, %
* you can use old result like: 2+3 [enter] 7+#/3 [enter] gives 4.
* input         output
  123-456       =-333
  123*456       =56088
  $1234%$100    =$34


##########################################################
#               EDIT                                     #
##########################################################
Test edit program:
  -l0 4
  -g0

Notes:
* can only edit one sector in 32 cols * 16 rows
* keys:
    move   - ArrowKeys
    remove - Backspace, Del
    end    - ESC


##########################################################
#               TETRIS                                   #
##########################################################
Play tetris:
  -l0 5
  -g0

Keys:
  j, 4  - move left
  k, 5  - rotate (counter clockwise)
  l, 6  - move right
  SPACE - drop
  ESC   - end


##########################################################
#               Write own program                        #
##########################################################
Tiny "Hello World" program:
  mov dx,message
  mov ah,func_OutStr
  int OS_INT
  retf
  message db "Hello World!",0Dh,0Ah,0
You must write it in hex format then you can save it into disk and run it:
  -e0 be 10 00 b4 07 cd 81 cb
  -e10 "Hello World!",0D,0A,0
  -w0 8
  -g0

Load, Dump and run program:
  -l0 8
  -d0
  -g0

Notes:
* program MUST end with retf (=CB in hex)
  or int 81h/ah=0 (tsr with int 81h/ah=1)
* there is full 64k segment for user program and 512k for tsr programs
  in (1000:0..9FFF:0), stack is in kernel segment 0:8000..0:FFFE.
  load/write over 512 bytes program you need update offset and sector
  number between sector load/write.
  l0 8
  l200 9
  l400 A
