Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit kernel;
- interface
- uses screen,multiboot;
- procedure kernel_main(address:Pmultiboot_tag);
- implementation
- procedure kernel_main(address:Pmultiboot_tag);[public,alias:'kernel_main'];
- var mycolour:pixelcolour;
- var framebuffer:Pmultiboot_tag_framebuffer;
- begin
- framebuffer:=NIL;
- // Skip past the first 8 bytes of the multiboot tag structure
- address:=address+1;
- // Look for the frame buffer tag. Stop when end tag found
- while address^.mtype <> MMULTIBOOT_TAG_TYPE_END do
- begin
- Case address^.mtype of
- MMULTIBOOT_TAG_TYPE_FRAMEBUFFER :
- framebuffer:=Pmultiboot_tag_framebuffer(address);
- end;
- // Move to the next tag on its 8 byte aligned address
- address:=Pmultiboot_tag(PByte(address) + ((address^.msize + 7) and (not 7)));
- end;
- kernelscreen:=Ppixelcolour(framebuffer^.common.framebuffer_addr);
- screenwidth:=framebuffer^.common.framebuffer_width;
- screenheight:=framebuffer^.common.framebuffer_height;
- mycolour.red:=127;
- mycolour.green:=0;
- mycolour.blue:=0;
- mycolour.alpha:=1;
- draw_rectangle(mycolour,200,200,600,400);
- while(True) do;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement