User:Johnburger/Demo/User/User

From OSDev Wiki
Jump to: navigation, search

The User Task is less than 256 bytes. It didn't need to be big, but I did want it be both visual and obvious what was happening. I also wanted it to be flexible to the configurable parameters, even changing modes when not given much room at all - I wanted to be able to stress the system and literally max out the number of Tasks running 'simultaneously'.

Note, though, that precisely because the Task is so simple, upon first start-up all the Tasks may look like they're in "lock-step" - as though they're producing the same output at the same time. This is because they are the same code, starting from the same startup conditions. One way to diverge the different Tasks is to introduce more interrupts. (After giving the virtual screen the focus...) Just press lots of keys, or hold one down. What will happen is that Tasks will be "kicked awake" to update their ball position again, and different Tasks will be at different stages through their execution. Slowly but surely they will begin to show independence.

Also note that it is here where I define the two macros for the two System Calls that are supported.

Demo/User/User.inc

;
; User/User.inc
;
 
                SEGMENT         User  VSTART=0  ALIGN=16
 
                USE32
 
%define         User.Halt       INT 48
%define         User.Yield      INT 49
 
;-------------------------------------------------------------------------------
%include        "User/LDT.inc"
;-------------------------------------------------------------------------------
%include        "User/Data.inc"
;-------------------------------------------------------------------------------
%include        "User/Code.inc"
;-------------------------------------------------------------------------------
%include        "User/Frame.inc"
Personal tools
Namespaces
Variants
Actions
Navigation
About
Toolbox