Subject: OFW `ls'
To: Ignatios Souvatzis <>
From: matthew green <>
List: tech-kern
Date: 05/31/1999 19:54:37
   About choosing the loaded program name: this can be done from OFW, too. Can
   we "ls" from OFW?

this is what an ultrasparc says when booting a with a
debugging bootblk (the thing generated with fgen that
is a forth program):

Rebooting with command: boot disk:d /pci@1f,0/pci@1,1/ide@3/disk@0,0:d/netbsd -s
Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:d  File and args: /pci@1f,0/pci@1,1/ide@3/disk@0,0:d/netbsd -s
NetBSD IEEE 1275 Bootblock
Loading file /ofwboot
from device /pci@1f,0/pci@1,1/ide@3/disk@0,0:d
ufs-open complete
.Looking for ofwboot in directory...
Found it
.Loading fed7  bytes of file...
>> NetBSD/sparc64 OpenFirmware Boot, Revision
>> (, Thu May 13 18:50:48 EST 1999)
devopen: getdisklabel sez no disk label
devopen: search_label sez no disk label
loadfile: reading header
elf32_exec: Booting /pci@1f,0/pci@1,1/ide@3/disk@0,0:d/netbsd

see the `.' `..' `lost+found' `netbsd' and `ofwboot' entries?
you'll find the code that does this in
arch/sparc64/stand/bootblk/bootblk.fth, in particular this

	: find-file ( load-file len -- )

i do not know of an existing simple 'ls' implementation, but
it couldn't be too hard... for anyone who understands forth,
anyway :-)  be a candidate for sys/stand perhaps?