Fix port-acorn32/15850: machdep.booted_kernel on acorn32 is incorrect.

This has been on my TODO list for some time and i found it time to fix it
since its pretty simple to do.

The patch checks if the kernel is booted from the `UnixFS' RISC OS filing
system (case unimportant) and if so interprets its name to get the unix
file name the kernel has. If it doesn't see this prefix it will asume its
just called `netbsd'
This commit is contained in:
reinoud 2002-03-10 01:28:19 +00:00
parent 60219ba2a6
commit 6d18a99125
1 changed files with 31 additions and 9 deletions

View File

@ -1,5 +1,5 @@
REM > BtNetBSD REM > BtNetBSD
REM $NetBSD: BtNetBSD,v 1.3 2002/02/11 19:00:07 reinoud Exp $ REM $NetBSD: BtNetBSD,v 1.4 2002/03/10 01:28:19 reinoud Exp $
REM REM
REM Copyright (c) 2000, 2001, 2002 Reinoud Zandijk REM Copyright (c) 2000, 2001, 2002 Reinoud Zandijk
REM Copyright (c) 1998, 1999, 2000 Ben Harris REM Copyright (c) 1998, 1999, 2000 Ben Harris
@ -78,6 +78,14 @@ REM get kernel name
file$ = LEFT$(args$, INSTR(args$, " ")-1) file$ = LEFT$(args$, INSTR(args$, " ")-1)
PRINT"Booting ";file$;" ";args$'' PRINT"Booting ";file$;" ";args$''
IF FNtolower(LEFT$(file$,9))="unixfs:$." THEN
kernelname$=MID$(file$, 10)
ELSE
kernelname$="netbsd" : REM RISC OS file namen zeggen niets XXX
ENDIF
REM Get some space to mess with REM Get some space to mess with
REM Declare a large array ... and then wipe it/map it in in the OS_Mem loop REM Declare a large array ... and then wipe it/map it in in the OS_Mem loop
REM the difference is that RO4 won't map it in by default and REM the difference is that RO4 won't map it in by default and
@ -502,14 +510,14 @@ DEF PROCload_kernel_aout(file%)
REM update new header structure REM update new header structure
new_hdr%!16 = symsize% new_hdr%!16 = symsize%
REM mark highest virtual address free in NetBSD's mapping REM mark highest virtual address free in NetBSD's mapping
vfreebase% = KERNEL_BASE + nbpp%*relocoff% vfreebase% = KERNEL_BASE + nbpp%*relocoff%
REM `patch' symbol table stuff REM `patch' symbol table stuff
ssym% = 0 ssym% = 0
esym% = 0 esym% = 0
PROCfinish_relocationtable PROCfinish_relocationtable
ENDPROC ENDPROC
@ -671,7 +679,7 @@ DEF PROCnew_configuration_structure
; u_char machine_id[4] ; u_char machine_id[4]
EQUD machineId% EQUD machineId%
; char kernelname[80] ; char kernelname[80]
EQUS LEFT$(file$+CHR$0+STRING$(80, " "), 80) EQUS LEFT$(kernelname$+CHR$0+STRING$(80, " "), 80)
; char args[512] ; char args[512]
EQUS args$+CHR$0 EQUS args$+CHR$0
]: P% += 512 - LEN(args$+CHR$0): [ OPT opt% ]: P% += 512 - LEN(args$+CHR$0): [ OPT opt%
@ -700,7 +708,7 @@ DEF PROCnew_configuration_structure
EQUD 0 EQUD 0
; u_int MDFsize ; u_int MDFsize
EQUD 0 EQUD 0
; u_int display_phys ; u_int display_phys
EQUD videomem_start% EQUD videomem_start%
; u_int display_start ; u_int display_start
@ -715,10 +723,10 @@ DEF PROCnew_configuration_structure
EQUD FNvdu_var(9) ; acorn32 port needs log(bitsperpixel)/log(2) EQUD FNvdu_var(9) ; acorn32 port needs log(bitsperpixel)/log(2)
; u_int framerate ; u_int framerate
EQUD 56 ; XXX why? EQUD 56 ; XXX why?
; char reserved[512] ; char reserved[512]
]: P% += 512: [ OPT opt% ]: P% += 512: [ OPT opt%
; u_int pagesize ; u_int pagesize
EQUD nbpp% EQUD nbpp%
; u_int drampages ; u_int drampages
@ -810,7 +818,7 @@ DEF PROCold_configuration_structure
;vrampages% ;vrampages%
EQUD totalvrampages% EQUD totalvrampages%
;kernelname% ;kernelname%
EQUS LEFT$(file$+CHR$0+STRING$(80, " "), 80) EQUS LEFT$(kernelname$+CHR$0+STRING$(80, " "), 80)
;framerate% ;framerate%
EQUD 56 ; XXXXX EQUD 56 ; XXXXX
;machine_id% ;machine_id%
@ -1070,7 +1078,7 @@ DEF PROCget_memory_configuration
loop% += 64 loop% += 64
PROCtwirl PROCtwirl
ENDWHILE ENDWHILE
IF emulateDRAMsize% > 0 THEN IF emulateDRAMsize% > 0 THEN
REM emulate HACK REM emulate HACK
DRAM0% = DRAM_addr%(0) DRAM0% = DRAM_addr%(0)
@ -1250,3 +1258,17 @@ DEF FNvdu_var(var%)
DEF FNroundup(val%, size%) DEF FNroundup(val%, size%)
=val% + (size% - 1) AND NOT (size% - 1) =val% + (size% - 1) AND NOT (size% - 1)
DEF FNtolower(name$)
LOCAL A$, Ch$, i%
FOR i%=1 TO LEN(name$)
Ch$ = LEFT$(name$,1)
IF Ch$>="A" AND Ch$<="Z" THEN
A$ += CHR$(ASC(Ch$)+ASC("a")-ASC("A"))
ELSE
A$ += Ch$
ENDIF
name$ = MID$(name$, 2)
NEXT
= A$