Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. DWORD equ dword
  2. WORD  equ word
  3. BYTE  equ byte
  4.  
  5. PTR   equ
  6.  
  7. _init:
  8.         push    esi
  9.         push    ebx
  10.         sub     esp, 4
  11.         mov     eax, DWORD PTR [_boot_mbi]
  12.         test    BYTE PTR [eax], 2
  13.         je      .L2
  14.         push    ecx
  15.         push    ecx
  16.         push    DWORD PTR [eax+12]
  17.         push    .LC0
  18.         call    _printf
  19.         add     esp, 16
  20. .L2:
  21.         mov     eax, DWORD PTR [_boot_mbi]
  22.         test    BYTE PTR [eax], 4
  23.         je      L4
  24.         push    edx
  25.         push    edx
  26.         push    DWORD PTR [eax+16]
  27.         push    .LC1
  28.         call    _printf
  29.         add     esp, 16
  30. .L4:
  31.         mov     eax, DWORD PTR [_boot_mbi]
  32.         test    BYTE PTR [eax], 8
  33.         je      .L6
  34.         push    esi
  35.         xor     esi, esi
  36.         push    DWORD PTR [eax+24]
  37.         push    DWORD PTR [eax+20]
  38.         push    .LC2
  39.         call    _printf
  40.         mov     eax, DWORD PTR [_boot_mbi]
  41.         mov     ebx, DWORD PTR [eax+24]
  42.         jmp     .L22
  43. .L9:
  44.         mov     eax, DWORD PTR [ebx-12]
  45.         inc     esi
  46.         push    DWORD PTR [ebx-8]
  47.         mov     DWORD PTR [_pg_balloc], eax
  48.         push    eax
  49.         push    DWORD PTR [ebx-16]
  50.         push    .LC3
  51.         call    _printf
  52. .L22:
  53.         mov     eax, DWORD PTR [_boot_mbi]
  54.         add     esp, 16
  55.         mov     edx, ebx
  56.         add     ebx, 16
  57.         cmp     esi, DWORD PTR [eax+20]
  58.         jb      .L9
  59.         mov     edx, DWORD PTR [edx-16]
  60.         push    ebx
  61.         push    ebx
  62.         sub     edx, 536870912
  63.         lea     eax, [edx+512]
  64.         mov     DWORD PTR [_rd_fat], eax
  65.         lea     eax, [edx+4790]
  66.         push    edx
  67.         push    .LC4
  68.         mov     DWORD PTR [_rd_fat_end], eax
  69.         lea     eax, [edx+9728]
  70.         mov     DWORD PTR [_rd_root], eax
  71.         lea     eax, [edx+16896]
  72.         mov     DWORD PTR [_rd_base], edx
  73.         mov     DWORD PTR [_rd_root_end], eax
  74.         call    _printf
  75.         add     esp, 16
  76. .L6:
  77.         mov     eax, DWORD PTR [_boot_mbi]
  78.         xor     esi, esi
  79.         test    BYTE PTR [eax], 64
  80.         je      .L13
  81.         push    ecx
  82.         push    DWORD PTR [eax+44]
  83.         push    DWORD PTR [eax+48]
  84.         push    .LC5
  85.         call    _printf
  86.         mov     eax, DWORD PTR [_boot_mbi]
  87.         add     esp, 16
  88.         mov     ebx, DWORD PTR [eax+48]
  89.         jmp     .L14
  90. .L15:
  91.         push    edx
  92.         push    DWORD PTR [ebx+20]
  93.         push    DWORD PTR [ebx+12]
  94.         push    DWORD PTR [ebx+16]
  95.         push    DWORD PTR [ebx+4]
  96.         push    DWORD PTR [ebx+8]
  97.         push    DWORD PTR [ebx]
  98.         push    .LC6
  99.         call    _printf
  100.         add     esp, 32
  101.         cmp     DWORD PTR [ebx+20], 1
  102.         jne     .L16
  103.         mov     eax, DWORD PTR [ebx+4]
  104.         add     eax, DWORD PTR [ebx+12]
  105.         and     eax, -4096
  106.         cmp     esi, eax
  107.         jae     .L16
  108.         mov     esi, eax
  109. .L16:
  110.         mov     eax, DWORD PTR [ebx]
  111.         add     eax, 4
  112.         lea     ebx, [eax+ebx]
  113. .L14:
  114.         mov     edx, DWORD PTR [_boot_mbi]
  115.         mov     eax, DWORD PTR [edx+48]
  116.         add     eax, DWORD PTR [edx+44]
  117.         cmp     ebx, eax
  118.         jb      .L15
  119.         cmp     esi, 268435456
  120.         jbe     .L13
  121.         mov     esi, 268435456
  122. .L13:
  123.         mov     DWORD PTR [_mem_amount], esi
  124.         pop     eax
  125.         pop     ebx
  126.         pop     esi
  127.         ret
  128.  
  129.  
  130. .LC0:
  131.         db "boot_device = 0x%x",10,0
  132. .LC1:
  133.         db "cmdline = %s",10,0
  134. .LC2:
  135.         db "mods_count = %d, mods_addr = 0x%x",10,0
  136. .LC3:
  137.         db " mod_start = 0x%x, mod_end = 0x%x, string = %s",10,0
  138. .LC4:
  139.         db " rd_base = %x",10,0
  140. .LC5:
  141.         db "mmap_addr = 0x%x, mmap_length = 0x%x",10,0
  142. .LC6:
  143.         db " size = 0x%x, base_addr = 0x%x%x, length = 0x%x%x, type = 0x%x",10,0
  144.  
  145.  
  146. restore DWORD
  147. restore WORD
  148. restore BYTE
  149.  
  150. restore PTR
  151.  
  152.