pedraom2007

kernel.asm

Oct 5th, 2021
1,659
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [BITS 16]
  2. [ORG 0000h]
  3.  
  4. jmp OSMain
  5.  
  6. %include "Hardware/monitor.inc"
  7. %include "Hardware/disk.inc"
  8. %include "Hardware/wmemory.inc"
  9.  
  10. OSMain:
  11.     call ConfigSegment
  12.     call ConfigStack
  13.     call VGA.SetVideoMode
  14.     call DrawBackground
  15.     call EffectInit
  16.     call GraphicInterface
  17.     jmp END
  18.  
  19. GraphicInterface:
  20.     mov byte[Window_Bar], 0
  21.     mov word[Window_Pos_X], 5
  22.     mov word[window_Pos_Y], 5
  23.     mov word[Window_Width], 100
  24.     mov word[Window_Height], 150
  25.     mov byte[Window_Border_Color], 42
  26.     mov byte[Sector], 3
  27.     mov byte[Drive], 80h
  28.     mov byte[NumSectors], 1
  29.     mov word[SegmentAddr], 0800h
  30.     mov word[OffsetAddr], 0500h
  31.     call ReadDisk
  32.     call WindowAdress
  33. ret
  34.  
  35. ; Kernel Funcs
  36.  
  37. ConfigSegment:
  38.     mov ax, es
  39.     mov ds, ax
  40. ret
  41.  
  42. ConfigStack:
  43.     mov ax, 7D00h
  44.     mov ss, ax
  45.     mov sp, 03FEh
  46. ret
  47.  
  48. END:
  49.     jmp $
  50.  
  51.  
  52.  
Advertisement
Add Comment
Please, Sign In to add comment