Advertisement
MichaelPetch

SO78304950 - kernel.pas

Apr 10th, 2024 (edited)
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. unit kernel;
  2.  
  3. interface
  4. uses screen,multiboot;
  5. procedure kernel_main(address:Pmultiboot_tag);
  6. implementation
  7. procedure kernel_main(address:Pmultiboot_tag);[public,alias:'kernel_main'];
  8. var mycolour:pixelcolour;
  9. var framebuffer:Pmultiboot_tag_framebuffer;
  10. begin
  11. framebuffer:=NIL;
  12.  
  13. // Skip past the first 8 bytes of the multiboot tag structure
  14. address:=address+1;
  15. // Look for the frame buffer tag. Stop when end tag found
  16. while address^.mtype <> MMULTIBOOT_TAG_TYPE_END do
  17. begin
  18. Case address^.mtype of
  19. MMULTIBOOT_TAG_TYPE_FRAMEBUFFER :
  20. framebuffer:=Pmultiboot_tag_framebuffer(address);
  21. end;
  22. // Move to the next tag on its 8 byte aligned address
  23. address:=Pmultiboot_tag(PByte(address) + ((address^.msize + 7) and (not 7)));
  24. end;
  25.  
  26. kernelscreen:=Ppixelcolour(framebuffer^.common.framebuffer_addr);
  27. screenwidth:=framebuffer^.common.framebuffer_width;
  28. screenheight:=framebuffer^.common.framebuffer_height;
  29. mycolour.red:=127;
  30. mycolour.green:=0;
  31. mycolour.blue:=0;
  32. mycolour.alpha:=1;
  33. draw_rectangle(mycolour,200,200,600,400);
  34. while(True) do;
  35. end;
  36. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement