OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /eco32/trunk/disk/tools/mkmboot
    from Rev 17 to Rev 86
    Reverse comparison

Rev 17 → Rev 86

/stage1/mbr.s
4,8 → 4,8
 
; Runtime environment:
;
; This code must be loaded and started at 0xC0000000.
; It allocates a stack from 0xC0001000 downwards. So
; This code must be loaded and started at 0xC0010000.
; It allocates a stack from 0xC0011000 downwards. So
; it must run within 4K (code + data + stack).
;
; This code expects the disk number of the boot disk
15,28 → 15,14
; The boot manager, which is loaded by this code,
; must be in standalone (headerless) executable
; format, stored at absolute disk sectors 2..31,
; and gets loaded and started at 0xC0001000.
; and gets loaded and started at 0xC0011000.
 
.set stacktop,0xC0001000 ; top of stack
.set loadaddr,0xC0001000 ; where to load the boot manager
.set stacktop,0xC0011000 ; top of stack
.set loadaddr,0xC0011000 ; where to load the boot manager
 
.set cout,0xE0000018 ; ROM console output
.set dskio,0xE0000030 ; ROM disk I/O
.set cout,0xC0000018 ; the monitor's console output
.set dskio,0xC0000030 ; the monitor's disk I/O
 
; reset arrives here
reset:
j start
 
; interrupts arrive here
intrpt:
j userMiss
 
; user TLB misses arrive here
userMiss:
add $4,$0,intmsg ; we do not expect any interrupt
jal msgout
j halt
 
; load the boot manager and start it
start:
add $29,$0,stacktop ; setup stack
113,8 → 99,6
j halt1
 
; messages
intmsg:
.byte "unexpected interrupt", 0x0D, 0x0A, 0
strtmsg:
.byte "MBR executing...", 0x0D, 0x0A, 0
dremsg:
/stage1/Makefile
7,7 → 7,7
all: mbr.bin
 
mbr.bin: mbr.o
$(BUILD)/bin/ld -h -rc 0xC0000000 -o mbr.bin mbr.o
$(BUILD)/bin/ld -h -rc 0xC0010000 -o mbr.bin mbr.o
 
mbr.o: mbr.s
$(BUILD)/bin/as -o mbr.o mbr.s
/stage2/biolib.s
2,9 → 2,9
; biolib.s -- basic I/O library
;
 
.set cin,0xE0000010
.set cout,0xE0000018
.set dskio,0xE0000030
.set cin,0xC0000010
.set cout,0xC0000018
.set dskio,0xC0000030
 
.export getc
.export putc
/stage2/mboot.c
253,10 → 253,10
continue;
}
/* load boot sector of selected partition */
readDisk(ptr[part].start, (unsigned char *) 0xC0000000, 1);
readDisk(ptr[part].start, (unsigned char *) 0xC0010000, 1);
/* check for signature */
if ((*((unsigned char *) 0xC0000000 + SECTOR_SIZE - 2) != 0x55) ||
(*((unsigned char *) 0xC0000000 + SECTOR_SIZE - 1) != 0xAA)) {
if ((*((unsigned char *) 0xC0010000 + SECTOR_SIZE - 2) != 0x55) ||
(*((unsigned char *) 0xC0010000 + SECTOR_SIZE - 1) != 0xAA)) {
printf("boot sector of partition %d has no signature\n", part);
continue;
}
266,6 → 266,6
/* boot manager finished, now go executing loaded boot sector */
startSector = ptr[part].start;
numSectors = ptr[part].size;
entryPoint = 0xC0000000;
entryPoint = 0xC0010000;
return 0;
}
/stage2/c0.s
41,7 → 41,7
add $8,$8,4
clrtest:
bltu $8,$9,clrloop
add $29,$0,0xC0010000 ; setup stack
add $29,$0,0xC0020000 ; setup stack
stw $16,$0,bootDisk ; make arguments available
stw $17,$0,startSector
stw $18,$0,numSectors
/stage2/Makefile
7,7 → 7,7
all: mboot.bin
 
mboot.bin: c0.o mboot.o biolib.o c1.o
$(BUILD)/bin/ld -h -rc 0xC0001000 -o mboot.bin \
$(BUILD)/bin/ld -h -rc 0xC0011000 -o mboot.bin \
c0.o mboot.o biolib.o c1.o
 
c0.o: c0.s

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.