Allocate memory for second stage instead of using an absolute address

This commit is contained in:
Laurent Vivier 2004-05-25 20:34:08 +00:00
parent b7666960ce
commit 660c23bc12
2 changed files with 13 additions and 14 deletions

View File

@ -9,12 +9,8 @@ all: first
first: first.o
$(OBJCOPY) -O binary first.o first
config.h:
echo ".equ base_address, $(BASE_ADDRESS)" > config.h.X
mv config.h.X config.h
first.o: first.S config.h
first.o: first.S
$(AS) -o first.o first.S
clean:
rm -f first *.o config.h
rm -f first *.o

View File

@ -4,8 +4,6 @@
*
*/
.include "config.h" /* defines base_address */
.equ drive_num, 1
.equ fsFromStart, 1
.equ sector_size, 512
@ -18,8 +16,8 @@
.equ first_level_size, 2 * sector_size
.equ second_level_size, floppy_size - first_level_size
.macro PBEject
.short 0xA017
.macro NewPtr
.short 0xA11E
.endm
.macro PBReadSync
@ -101,21 +99,26 @@ ioPosOffset: /* ioPosOffset : positionning offset */
*****************************************************************************/
start:
move.l #base_address, %d0
/* Allocate Memory for second stage loader */
lea ioReqCount(%pc),%a0
move.l (%a0), %d0
NewPtr
move.l %a0, %d0
/* save result in the ParamBlockRec.ioBuffer */
lea ioBuffer,%a0
lea ioBuffer(%pc),%a0
move.l %d0,(%a0)
/* Now, we load the second stage loader */
lea param_block,%a0
lea param_block(%pc),%a0
PBReadSync
/* call second stage bootloader */
move.l ioBuffer,%a0
move.l ioBuffer(%pc),%a0
jmp (%a0)
end: