wok diff linld/stuff/src/VCPI.ASM @ rev 20295

Add python-humanize, python-pyajam, python-paho-mqtt
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Apr 25 16:08:37 2018 +0200 (2018-04-25)
parents e7715725d95b
children 46b511e941a7
line diff
     1.1 --- a/linld/stuff/src/VCPI.ASM	Mon Apr 10 18:13:03 2017 +0200
     1.2 +++ b/linld/stuff/src/VCPI.ASM	Wed Apr 25 16:08:37 2018 +0200
     1.3 @@ -145,52 +145,44 @@
     1.4                  ;push    bx
     1.5                  ;push    ax
     1.6  prepare_vcpi:
     1.7 -                ;push    esi
     1.8 -                ;push    es
     1.9  
    1.10  ;Calculate pagedir/page0 addrs, initialize cr3 and pagedir[0]
    1.11                  xor     eax,eax
    1.12  ;    heap_top = prepare_vcpi(malloc_or_die(8*1024+4)); 
    1.13  		mov	cx,8*1024+4
    1.14                  extrn   malloc_or_die:near
    1.15 -		call	malloc_or_die
    1.16 +		call	malloc_or_die	;keep cx
    1.17  
    1.18 -		mov	cl,4
    1.19                  mov     edx,cs
    1.20                  shl     edx,cl          ;edx = linear addr of CS
    1.21                  mov     si,offset gdt_vcpi
    1.22  ; Fix up base of some gdt descriptors
    1.23  ; Note: 'add [dword xx.base0],edx' actually updates 24 bit quantity!
    1.24  ; Do NOT replace with mov!
    1.25 -		mov	bx,-28h
    1.26 +		mov	ebx,10000h-28h
    1.27                  add     [dword bx+si+sw2pm_idtr_ptr-gdt_vcpi+28h],edx
    1.28  @@fixup:
    1.29                  add     [dword bx+si+(gdt_code.base0)-gdt_vcpi+28h],edx
    1.30 -		add	bl,8
    1.31 +		add	bx,8
    1.32  		js	@@fixup
    1.33 +		mov	bh,10h
    1.34                  add     eax,edx
    1.35 -		dec	eax
    1.36 -                shr     eax,cl
    1.37 -		inc	ah
    1.38 -                mov     al,0   ;eax = 4k aligned linear addr of pagebuf
    1.39 -                mov     es,ax           ;es:0->page0,es:1000h->pagedir
    1.40 -                shl     eax,cl          ;eax=page0 linear addr
    1.41 +		and	ax,0f000h       ;eax = 4k aligned linear addr of pagebuf
    1.42 +                add     eax,ebx         ;eax=page0 linear addr
    1.43                  add     [si+sw2pm_cr3-gdt_vcpi],eax
    1.44 -                mov     di,ax
    1.45 +                mov     edi,eax
    1.46 +                sub     edi,edx
    1.47                  mov     al,3            ;add present+writable bits
    1.48 -                mov     [es:1000h],eax     ;stuff it into pagedir[0]
    1.49 +                mov     [bx+di],eax     ;stuff it into pagedir[0]
    1.50                  push    ds
    1.51 -                pop     es
    1.52 -                sub     di,dx           ;ES:DI => page0
    1.53 +                pop     es              ;es:di->page0,es:di+1000h->pagedir
    1.54                          ;page directory will use only one entry (4 bytes):
    1.55                          ;cr3 => pagedir => page0  => ########
    1.56                          ;      (1 entry)  (1024   => #  4M  #
    1.57                          ;                 entries)=> # page #
    1.58                          ;                         => ########
    1.59  ; Return
    1.60 -                ;pop     es
    1.61 -                ;pop     esi
    1.62 -                lea     ax,[di+1004h]
    1.63 +                lea     ax,[bx+di+4]
    1.64  		extrn	_heap_top:word
    1.65  		mov	[_heap_top],ax
    1.66                  ;ret