* Copyright (c) 1990 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* %sccs.include.noredist.c%
* @(#)srt0.c 7.2 (Berkeley) %G%
* Startup code for standalone system
* Non-relocating version -- for programs which are loaded by boot
* Relocating version for boot
* Small relocating version for "micro" boot
/* where the disklabel goes if we have one */
#if defined(REL) && !defined(SMALL)
/* relocate program and enter at symbol "start" */
#movl $entry-RELOC,%esi # from beginning of ram
#movl $entry,%edi # to relocated area
movl $ RELOC
,%edi
# to relocated area
# movl $_edata-RELOC,%ecx # this much
# relocate program counter to relocation base
/* setup stack pointer */
leal
4(%esp
),%eax
/* ignore old pc */
/* copy down boot parameters */
/* save old stack state */
/* clear memory as needed */
* Clear Bss and up to 64K heap
movl $_end
,%eax
# should be movl $_end-_edata but ...
call _kbdreset
/* resets keyboard and gatea20 brain damage */
savearea
: .long 0,0 # sp & bp to return to
movw
%ax
,0x472 # warm boot
movl $
0,%esp
# segment violation
# NOTE: does not (yet) handle overlapped copies
.byte
0x66,0xf2,0x6d # rep insw
.byte
0x66,0xf2,0x6f # rep outsw