Rev 381 | Rev 392 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 381 | Rev 390 | ||
---|---|---|---|
Line 37... | Line 37... | ||
37 | .global paging_on |
37 | .global paging_on |
38 | .global enable_l_apic_in_msr |
38 | .global enable_l_apic_in_msr |
39 | .global interrupt_handlers |
39 | .global interrupt_handlers |
40 | .global memsetb |
40 | .global memsetb |
41 | .global memsetw |
41 | .global memsetw |
42 | .global memcmp |
- | |
43 | - | ||
44 | 42 | ||
45 | ## Turn paging on |
43 | ## Turn paging on |
46 | # |
44 | # |
47 | # Enable paging and write-back caching in CR0. |
45 | # Enable paging and write-back caching in CR0. |
48 | # |
46 | # |
Line 200... | Line 198... | ||
200 | pop %eax |
198 | pop %eax |
201 | 199 | ||
202 | ret |
200 | ret |
203 | 201 | ||
204 | 202 | ||
205 | ## Compare memory regions for equality |
- | |
206 | # |
- | |
207 | # Compare a given number of bytes (3rd argument) |
- | |
208 | # at memory locations defined by 1st and 2nd argument |
- | |
209 | # for equality. If the bytes are equal, EAX contains 0. |
- | |
210 | # |
- | |
211 | SRC=12 |
- | |
212 | DST=16 |
- | |
213 | CNT=20 |
- | |
214 | memcmp: |
- | |
215 | push %esi |
- | |
216 | push %edi |
- | |
217 | - | ||
218 | movl CNT(%esp),%ecx |
- | |
219 | movl DST(%esp),%edi |
- | |
220 | movl SRC(%esp),%esi |
- | |
221 | - | ||
222 | repe cmpsb %es:(%edi),%ds:(%esi) |
- | |
223 | movl %ecx,%eax # %ecx contains the return value (zero on success) |
- | |
224 | - | ||
225 | pop %edi |
- | |
226 | pop %esi |
- | |
227 | - | ||
228 | ret |
- | |
229 | - | ||
230 | - | ||
231 | # THIS IS USERSPACE CODE |
203 | # THIS IS USERSPACE CODE |
232 | .global utext |
204 | .global utext |
233 | utext: |
205 | utext: |
234 | xor %ax,%ax |
206 | xor %ax,%ax |
235 | mov %ax,%ds |
207 | mov %ax,%ds |