Guest User

Untitled

a guest
Mar 4th, 2017
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org 0x7C00
  2.  
  3. startboot:
  4.         cli
  5.         xor ax,ax
  6.         mov ds,ax
  7.         mov es,ax
  8.         mov ss,ax
  9.         mov sp,0x7C00
  10.         sti
  11.         jmp 0x7E00
  12.  
  13. ;-------------------------------------------------
  14.  
  15. finish: times 0x1FE-finish+startboot db 0
  16. db 0x55,0xAA
  17.  
  18. ;-------------------------------------------------
  19. ;+++++++++++++++++++++++++++++++++++++++++++++++++
  20. ;-------------------------------------------------
  21.  
  22. org 0x7E00
  23.     jmp start_system
  24.  
  25. ;-------------------------------------------------
  26.  
  27. ;adr 0x7E08
  28. ;pred 31
  29.  
  30. GDT dp 000000000000000001111110000010000000000000011111b
  31.  
  32.        ;      24    16.9  L ype
  33. GDT0 dq 0;adr_31GDXU_p_1PDPS_t_A_adres_23...0...........predel_15...0...
  34. GDT1 dq 0000000011001111000111000000000000000000000000001111111111111111b ;kod
  35. GDT2 dq 0000000011001111000101000000000000000000000000001111111111111111b ;dan
  36. GDT3 dq 0000000011000000000101100000000010110011100110011011011110011001b ;stk
  37.  
  38. ;-------------------------------------------------
  39.  
  40. start_system:
  41.         mov ax,0x4F02
  42.         mov bx,0x4118
  43.         int 0x10
  44.         in al,0x92
  45.         or al,2
  46.         out 0x92,al
  47.         lgdt [GDT]
  48.         cli
  49.         in al,0x70
  50.         or al,0x80
  51.         out 0x70,al
  52.         mov eax,cr0
  53.         or al,1
  54.         mov cr0,eax
  55.         jmp 0x8:con
  56. con:
  57.         ;mov ax,cs
  58.         ;mov ax,16
  59.         ;mov ds,ax
  60.         ;mov es,ax
  61.         ;mov ax,24
  62.         ;mov ss,ax
  63.         mov edi,0xA0000
  64.  
  65. vs:
  66.         jmp vs
  67.  
  68. ;-------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment