Subversion Repositories Kolibri OS

Rev

Rev 864 | 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: 928 $
  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 core_init
  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.            cli
  68.  
  69.            mov eax, cr0
  70.            or eax, CR0_PG+CR0_WP+CR0_PE
  71.            mov cr0, eax
  72.  
  73.            jmp pword 0x10:core_init
  74.  
  75. align 4
  76. rmode_idt:
  77.            dw 0x400
  78.            dd 0
  79.            dw 0
  80.  
  81. align 4
  82. _poweroff:
  83.            mov eax, cr0
  84.            and eax, not 0x80000001
  85.            mov cr0, eax
  86.            jmp far 0x1000:@F
  87. @@:
  88.            mov eax, 0x3000
  89.            mov ss, ax
  90.            mov esp, 0xEC00
  91.  
  92.            mov ebx, 0x1000
  93.            mov ds, bx
  94.            mov es, bx
  95.  
  96.            lidt [rmode_idt]
  97.  
  98. APM_PowerOff:
  99.            mov     ax, 5304h
  100.            xor     bx, bx
  101.            int     15h
  102. ;!!!!!!!!!!!!!!!!!!!!!!!!
  103.            mov ax,0x5300
  104.            xor bx,bx
  105.            int 0x15
  106.            push ax
  107.  
  108.            mov ax,0x5301
  109.            xor bx,bx
  110.            int 0x15
  111.  
  112.            mov ax,0x5308
  113.            mov bx,1
  114.            mov cx,bx
  115.            int 0x15
  116.  
  117.            mov ax,0x530E
  118.            xor bx,bx
  119.            pop cx
  120.            int 0x15
  121.  
  122.            mov ax,0x530D
  123.            mov bx,1
  124.            mov cx,bx
  125.            int 0x15
  126.  
  127.            mov ax,0x530F
  128.            mov bx,1
  129.            mov cx,bx
  130.            int 0x15
  131.  
  132.            mov ax,0x5307
  133.            mov bx,1
  134.            mov cx,3
  135.            int 0x15
  136. ;!!!!!!!!!!!!!!!!!!!!!!!!
  137.  
  138.            jmp $
  139.  
  140.  
  141. align 4
  142. _16bit_end:
  143.