Subversion Repositories Kolibri OS

Rev

Rev 855 | Rev 864 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. format MS COFF
  3.  
  4.  
  5. include '../macros.inc'
  6.  
  7. $Revision: 849 $
  8.  
  9. __REV__ = __REV
  10.  
  11. include "../proc32.inc"
  12. include "../kglobals.inc"
  13. include "../lang.inc"
  14.  
  15. CR0_PE         equ    0x00000001   ;protected mode
  16. CR0_WP         equ    0x00010000   ;write protect
  17. CR0_PG         equ    0x80000000   ;paging
  18.  
  19. public _16bit_start
  20. public _16bit_end
  21.  
  22. public _enter_bootscreen
  23. public _poweroff
  24.  
  25. public _bx_from_load
  26.  
  27. extrn __setvars
  28.  
  29. section '.boot' code readable align 16
  30.  
  31. _16bit_start:
  32.  
  33. org 0
  34.  
  35. use16
  36.  
  37. _enter_bootscreen:
  38.  
  39.            mov eax, cr0
  40.            and eax, not 0x80000001
  41.            mov cr0, eax
  42.            jmp far 0x1000:start_of_code
  43.  
  44. version db    'Kolibri OS  version 0.7.1.0      ',13,10,13,10,0
  45.  
  46. include "bootstr.inc"     ; language-independent boot messages
  47. include "preboot.inc"
  48.  
  49. if lang eq en
  50. include "booteng.inc"     ; english system boot messages
  51. else if lang eq ru
  52. include "bootru.inc"      ; russian system boot messages
  53. include "ru.inc"          ; Russian font
  54. else if lang eq et
  55. include "bootet.inc"      ; estonian system boot messages
  56. include "et.inc"          ; Estonian font
  57. else
  58. include "bootge.inc"      ; german system boot messages
  59. end if
  60.  
  61. include "../data16.inc"
  62.  
  63. include "bootcode.inc"    ; 16 bit system boot code
  64. include "../bus/pci/pci16.inc"
  65. include "../detect/biosdisk.inc"
  66.  
  67.  
  68.            cli
  69.  
  70.            mov eax, cr0
  71.            or eax, CR0_PG+CR0_WP+CR0_PE
  72.            mov cr0, eax
  73.  
  74.            jmp pword 0x08:__setvars
  75.  
  76.  
  77. ;align 4
  78. ;_leave_16bit:
  79. ;
  80. ;           cli
  81. ;           mov eax, cr0
  82. ;           or eax, CR0_PG+CR0_WP+CR0_PE
  83. ;           mov cr0, eax
  84. ;           hlt
  85.  
  86. align 4
  87. rmode_idt:
  88.            dw 0x400
  89.            dd 0
  90.            dw 0
  91.  
  92. align 4
  93. _poweroff:
  94.            mov eax, cr0
  95.            and eax, not 0x80000001
  96.            mov cr0, eax
  97.            jmp far 0x1000:@F
  98. @@:
  99.            mov eax, 0x3000
  100.            mov ss, ax
  101.            mov esp, 0xEC00
  102.  
  103.            mov ebx, 0x1000
  104.            mov ds, bx
  105.            mov es, bx
  106.  
  107.            lidt [rmode_idt]
  108.  
  109. APM_PowerOff:
  110.            mov     ax, 5304h
  111.            xor     bx, bx
  112.            int     15h
  113. ;!!!!!!!!!!!!!!!!!!!!!!!!
  114.            mov ax,0x5300
  115.            xor bx,bx
  116.            int 0x15
  117.            push ax
  118.  
  119.            mov ax,0x5301
  120.            xor bx,bx
  121.            int 0x15
  122.  
  123.            mov ax,0x5308
  124.            mov bx,1
  125.            mov cx,bx
  126.            int 0x15
  127.  
  128.            mov ax,0x530E
  129.            xor bx,bx
  130.            pop cx
  131.            int 0x15
  132.  
  133.            mov ax,0x530D
  134.            mov bx,1
  135.            mov cx,bx
  136.            int 0x15
  137.  
  138.            mov ax,0x530F
  139.            mov bx,1
  140.            mov cx,bx
  141.            int 0x15
  142.  
  143.            mov ax,0x5307
  144.            mov bx,1
  145.            mov cx,3
  146.            int 0x15
  147. ;!!!!!!!!!!!!!!!!!!!!!!!!
  148.  
  149.            jmp $
  150.  
  151.  
  152. align 4
  153. _16bit_end:
  154.