btxldr.S (58871) | btxldr.S (61064) |
---|---|
1# 2# Copyright (c) 1998 Robert Nordier 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms are freely 6# permitted provided that the above copyright notice and this 7# paragraph and the following disclaimer are duplicated in all 8# such forms. 9# 10# This software is provided "AS IS" and without any express or 11# implied warranties, including, without limitation, the implied 12# warranties of merchantability and fitness for a particular 13# purpose. 14# 15 | 1# 2# Copyright (c) 1998 Robert Nordier 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms are freely 6# permitted provided that the above copyright notice and this 7# paragraph and the following disclaimer are duplicated in all 8# such forms. 9# 10# This software is provided "AS IS" and without any express or 11# implied warranties, including, without limitation, the implied 12# warranties of merchantability and fitness for a particular 13# purpose. 14# 15 |
16# $FreeBSD: head/sys/boot/pc98/btx/btxldr/btxldr.S 58871 2000-03-31 16:03:02Z kato $ | 16# $FreeBSD: head/sys/boot/pc98/btx/btxldr/btxldr.S 61064 2000-05-29 11:58:01Z nyan $ |
17 18# 19# Prototype BTX loader program, written in a couple of hours. The 20# real thing should probably be more flexible, and in C. 21# 22 23# 24# Memory locations. --- 241 unchanged lines hidden (view full) --- 266 loop start.4 # Till done 267start.7: 268ifdef(`BTXLDR_VERBOSE',` 269 movl $m_done,%esi # Display done 270 call putstr # message 271') 272 movl $start.8,%esi # Real mode stub 273 movl $MEM_STUB,%edi # Destination | 17 18# 19# Prototype BTX loader program, written in a couple of hours. The 20# real thing should probably be more flexible, and in C. 21# 22 23# 24# Memory locations. --- 241 unchanged lines hidden (view full) --- 266 loop start.4 # Till done 267start.7: 268ifdef(`BTXLDR_VERBOSE',` 269 movl $m_done,%esi # Display done 270 call putstr # message 271') 272 movl $start.8,%esi # Real mode stub 273 movl $MEM_STUB,%edi # Destination |
274 movl $SIZ_STUB,%ecx # Size | 274 movl $start.9-start.8,%ecx # Size |
275 rep # Relocate 276 movsb # it 277 ljmp $SEL_RCODE,$MEM_STUB # To 16-bit code | 275 rep # Relocate 276 movsb # it 277 ljmp $SEL_RCODE,$MEM_STUB # To 16-bit code |
278start.8: xorl %eax,%eax # Data | 278 .code16 279start.8: xorw %ax,%ax # Data |
279 movb $SEL_RDATA,%al # selector | 280 movb $SEL_RDATA,%al # selector |
280 movl %eax,%ss # Reload SS 281 movl %eax,%ds # Reset 282 movl %eax,%es # other 283 movl %eax,%fs # segment 284 movl %eax,%gs # limits | 281 movw %ax,%ss # Reload SS 282 movw %ax,%ds # Reset 283 movw %ax,%es # other 284 movw %ax,%fs # segment 285 movw %ax,%gs # limits |
285 movl %cr0,%eax # Switch to | 286 movl %cr0,%eax # Switch to |
286 decl %eax # real | 287 decw %ax # real |
287 movl %eax,%cr0 # mode | 288 movl %eax,%cr0 # mode |
288 .byte 0xea # Jump to 289 .word MEM_ENTRY # BTX entry 290 .word 0x0 # point | 289 ljmp $0,$MEM_ENTRY # Jump to BTX entry point |
291start.9: | 290start.9: |
291 .code32 |
|
292# 293# Output message [ESI] followed by EAX in hex. 294# 295hexout: pushl %eax # Save 296 call putstr # Display message 297 popl %eax # Restore 298 pushl %esi # Save 299 pushl %edi # caller's --- 172 unchanged lines hidden --- | 292# 293# Output message [ESI] followed by EAX in hex. 294# 295hexout: pushl %eax # Save 296 call putstr # Display message 297 popl %eax # Restore 298 pushl %esi # Save 299 pushl %edi # caller's --- 172 unchanged lines hidden --- |