Fix for new ZMAGIC. Define start address.

This commit is contained in:
brezak 1993-10-26 15:52:55 +00:00
parent 32ee2e4e3f
commit 5be77b1847
4 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.2 1993/08/02 17:52:45 mycroft Exp $
# $Id: Makefile,v 1.3 1993/10/26 15:52:55 brezak Exp $
# uncomment one of these as appropriate for the board being used
#ETH_OBJ = ne2100.o
@ -34,11 +34,6 @@ ROM_SIZE = 16384
$(AS) $*.i -a -o /dev/null > $@; \
fi
#AS = as
#CC = cc
#LD = ld
# the relocation address (hex)
RELOC = 98000
CFLAGS = -O $(DEFINES) -nostdinc
@ -51,7 +46,7 @@ OBJS = start.o main.o cga.o kbd.o packet.o tftp.o arp.o \
all: boot.bin
boot.bin: $(OBJS) genprom
${LD} -N -T ${RELOC} $(OBJS)
${LD} -e _start -N -T ${RELOC} $(OBJS)
cp a.out boot.sym
rm -f $@
strip a.out

View File

@ -27,7 +27,7 @@
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*
* $Id: main.c,v 1.3 1993/08/02 17:52:56 mycroft Exp $
* $Id: main.c,v 1.4 1993/10/26 15:52:57 brezak Exp $
*/
/*
@ -66,6 +66,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "proto.h"
u_long work_area_org = RELOC;
u_long kernel_size;
u_short real_cs;
@ -100,7 +101,7 @@ LoadProgFromServer(ipaddr_t server, ipaddr_t gateway, char *file_name) {
if (Read(&head, sizeof(head)) != sizeof(head))
return load_bad_size;
if (head.a_magic != 0413 ) {
if (N_GETMAGIC(head) != ZMAGIC) {
printf("Invalid format!\n");
return load_bad_format;
}

View File

@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: nbtypes.h,v 1.2 1993/08/02 17:52:58 mycroft Exp $
* $Id: nbtypes.h,v 1.3 1993/10/26 15:52:59 brezak Exp $
*/
#ifndef __nbtypes_h_
@ -50,7 +50,7 @@ typedef unsigned long u_long;
typedef int jmp_buf[_JBLEN];
struct exec {
long a_magic; /* magic number */
long a_midmag; /* magic number */
unsigned long a_text; /* text segment size */
unsigned long a_data; /* initialized data size */
unsigned long a_bss; /* uninitialized data size */
@ -60,6 +60,11 @@ unsigned long a_trsize; /* text relocation size */
unsigned long a_drsize; /* data relocation size */
};
#define N_GETMAGIC(ex) \
( (((ex).a_midmag)&0xffff0000) ? (ntohl(((ex).a_midmag))&0xffff) : ((ex).a_midmag))
#define ZMAGIC 0413 /* demand load format */
#if 0
typedef char *va_list;
#define __va_promote(type) \

View File

@ -1,4 +1,4 @@
/* $Id: start.s,v 1.2 1993/08/02 17:53:03 mycroft Exp $ */
/* $Id: start.s,v 1.3 1993/10/26 15:52:59 brezak Exp $ */
#include "asm.h"
@ -11,6 +11,7 @@
.byte 0 /* no. of 512B blocks */
jmp 1f /* enter from bios here */
.byte 0 /* checksum */
ENTRY(start)
1:
cli
# save the bios return address in these registers until protected