Rev 149 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 149 | Rev 243 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | E820_RECORD_SIZE = MEMMAP_E820_RECORD_SIZE |
32 | E820_RECORD_SIZE = MEMMAP_E820_RECORD_SIZE |
33 | E820_MAX_RECORDS = MEMMAP_E820_MAX_RECORDS |
33 | E820_MAX_RECORDS = MEMMAP_E820_MAX_RECORDS |
34 | E820_SMAP = 0x534d4150 |
34 | E820_SMAP = 0x534d4150 |
35 | 35 | ||
36 | .global memmap_arch_init |
36 | .global memmap_arch_init |
37 | .global e820counter |
- | |
38 | .global e820table |
- | |
39 | .global e801memorysize |
37 | .global e801memorysize |
40 | 38 | ||
41 | .code16 |
39 | .code16 |
42 | .section K_TEXT_START_2 |
40 | .section K_TEXT_START_2 |
43 | 41 | ||
Line 45... | Line 43... | ||
45 | 43 | ||
46 | e820begin: |
44 | e820begin: |
47 | xorl %ebx,%ebx # during first call, ebx must be 0 |
45 | xorl %ebx,%ebx # during first call, ebx must be 0 |
48 | movw %bx,%ds |
46 | movw %bx,%ds |
49 | movw %bx,%es |
47 | movw %bx,%es |
50 | movw $e820table,%di |
48 | movw $e820table_boot,%di |
51 | movb $E820_MAX_RECORDS,e820counter |
49 | movb $E820_MAX_RECORDS,e820counter_boot |
52 | e820loop: |
50 | e820loop: |
53 | movl $E820_SMAP,%edx # control sequence "SMAP" |
51 | movl $E820_SMAP,%edx # control sequence "SMAP" |
54 | 52 | ||
55 | movl $0x0000e820,%eax # service |
53 | movl $0x0000e820,%eax # service |
56 | movl $E820_RECORD_SIZE,%ecx |
54 | movl $E820_RECORD_SIZE,%ecx |
Line 65... | Line 63... | ||
65 | 63 | ||
66 | movw %di,%ax # next record |
64 | movw %di,%ax # next record |
67 | addw $E820_RECORD_SIZE,%ax |
65 | addw $E820_RECORD_SIZE,%ax |
68 | movw %ax,%di |
66 | movw %ax,%di |
69 | 67 | ||
70 | decb e820counter # buffer is full |
68 | decb e820counter_boot # buffer is full |
71 | jz e820end |
69 | jz e820end |
72 | 70 | ||
73 | cmpl $0,%ebx |
71 | cmpl $0,%ebx |
74 | jne e820loop |
72 | jne e820loop |
75 | 73 | ||
76 | e820end: |
74 | e820end: |
77 | movb $E820_MAX_RECORDS,%al |
75 | movb $E820_MAX_RECORDS,%al |
78 | subb e820counter,%al |
76 | subb e820counter_boot,%al |
79 | movb %al,e820counter # store # of valid entries in e820counter |
77 | movb %al,e820counter_boot # store # of valid entries in e820counter |
80 | 78 | ||
81 | jmp e801begin |
79 | jmp e801begin |
82 | 80 | ||
83 | e820err: |
81 | e820err: |
84 | movb $0,e820counter |
82 | movb $0,e820counter_boot |
85 | 83 | ||
86 | # method e801 - get size of memory |
84 | # method e801 - get size of memory |
87 | 85 | ||
88 | e801begin: |
86 | e801begin: |
89 | xorw %dx,%dx |
87 | xorw %dx,%dx |
Line 115... | Line 113... | ||
115 | ret |
113 | ret |
116 | 114 | ||
117 | #memory size in 1 kb chunks |
115 | #memory size in 1 kb chunks |
118 | e801memorysize: |
116 | e801memorysize: |
119 | .long 0 |
117 | .long 0 |
120 | - | ||
121 | e820counter: |
- | |
122 | .byte 0xff |
- | |
123 | 118 | ||
124 | e820table: |
- | |
125 | .space (32*E820_RECORD_SIZE),0xff # space for 32 records, each E820_RECORD_SIZE bytes long |
- | |
126 | 119 |