wok view syslinux/stuff/iso2exe/ifmem.S @ rev 20632
linld: 32 bits lseeks for tazboot
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jan 05 17:23:23 2019 +0100 (2019-01-05) |
parents | |
children |
line source
1 .code16
2 .org 0
3 type_of_loader = 0x10
5 orw $0x8020, type_of_loader(%si) # loader type = 0x20 = bootsect-loader
6 pushal
8 movw $10+16, %cx
9 fillbuf:
10 pushw $0
11 loop fillbuf
12 popal // clear regiters
13 maploop:
14 movw %sp, %di // %es = %ss
15 movb $20, %cl
16 movw $0xE820, %ax
17 movl $0x534d4150, %edx
18 int $0x15
19 sbbl %eax, %edx
20 jne mapdone
21 decw 16(%di)
22 jne notram
23 addw 8+2(%di), %bp
24 notram:
25 orw %bx, %bx
26 jnz maploop
27 mapdone:
28 addw $20, %sp
29 shrw $20-16,%bp
30 jnz mapdone2
31 movb $0x88, %ah
32 int $0x15
33 xchgw %ax, %bp
34 shrw $10, %bp
35 mapdone2:
36 incw %bp
37 // %bp : nb Mb
38 call here
39 here:
40 popw %di
41 movw $0x1EE, %si
42 lodsw
43 sizeloop:
44 scasw // %di += 2
45 addw $4, %ax
46 cmpb %al, (%si)
47 jbe sizedone
48 cmpw %bp, sizes-here(%di)
49 jbe sizeloop
50 movb %al, (%si)
51 sizedone:
52 popal
53 lret // need %si
54 sizes: