Part 2 of the overlapping kzip changes.

Submitted by:	Gary Jones(?) <gj@freefall>
This commit is contained in:
Peter Wemm 1995-10-06 02:57:26 +00:00
parent a936507ae9
commit c196603b4d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11252
3 changed files with 31 additions and 13 deletions

View file

@ -1,8 +1,10 @@
# $Id: Makefile,v 1.2 1995/05/29 01:38:03 phk Exp $
# $Id: Makefile,v 1.3 1995/08/15 19:36:02 joerg Exp $
PROG= kzip.o
PROG= kztail.o kzhead.o
BINMODE = 444 # target is a relocatable object
SRCS= head.S boot.c unzip.c misc.c malloc.c inflate.c
SRCS= tail.S head.S boot.c unzip.c misc.c malloc.c inflate.c
OBJS_KZHEAD= head.o
OBJS_KZTAIL= tail.o boot.o unzip.o misc.o malloc.o inflate.o
BINDIR= /usr/lib
.PATH: ${.CURDIR}/../../../kern
NOMAN= toobad
@ -13,12 +15,15 @@ KADDR = 0x100000
# What segment our code lives in
CSEG = 0x8
STRIP= # very important!! don't let kzip.o be stripped
STRIP= # very important!! don't let kz*.o be stripped
CFLAGS+= -DKADDR=$(KADDR) -DCSEG=$(CSEG)
CFLAGS+= -DKZIP -DCOMCONSOLE=0x3F8
kzip.o: ${OBJS}
$(LD) -r -x -o kzip.o $(OBJS)
kztail.o: ${OBJS_KZTAIL}
$(LD) -r -x -o kztail.o $(OBJS_KZTAIL)
kzhead.o: ${OBJS_KZHEAD}
$(LD) -r -x -o kzhead.o $(OBJS_KZHEAD)
.include <bsd.prog.mk>

View file

@ -1,12 +1,13 @@
/*
* Boot unpacker startup routine.
* Leader for kernel
* This needs to be at the beginning, so the start address is passed
* to the boot loader
* Copyright (C) Serge Vakulenko
*/
.text
start:
.globl kzstart
kzstart:
cli # disable interrupts
pushl 4(%esp) # pass howto arg
call _boot # unpack the kernel image
popl %eax # discard howto arg
ljmp $CSEG, $KADDR # jump to unpacked kernel
. = start + 0x500 # skip over warm boot shit
call start # unpack the kernel image
# never return here.
. = kzstart + 0x500 # skip warm boot stuff

View file

@ -0,0 +1,12 @@
/*
* Boot unpacker startup routine.
* Copyright (C) Serge Vakulenko
*/
.text
.globl start
start:
popl %eax # remove return addr
pushl 4(%esp) # pass howto arg
call _boot # unpack the kernel image
popl %eax # discard howto arg
ljmp $CSEG, $KADDR # jump to unpacked kernel