[OpenBIOS] Device Tree and FCode evaluator
Stefan Reinauer
stepan at openbios.org
Wed Nov 19 23:27:30 CET 2003
Hi,
the current openbios cvs contains a lot of new code from the device
interface. We have a device tree now and can evaluate FCode on device
option ROMs.
Now OpenBIOS lacks a whole lot of Open Firmware "support packages" like the
deblocker, tftp booting for network interfaces, the terminal emulator,
filesystem support, etc etc.
And of course: OpenBIOS needs device drivers! Open Source drivers,
vendor FCode, everything that helps OpenBIOS to support a wide range of
hardware ;-)
I started setting the framework for the support packages in
openbios/forth/packages, find one source file per support package.
Also, there's an example fcode driver coming with the QT-Plugin of the
openbios kernel: openbios/kernel/plugins/plugin_qt/qt_rom.fs
I'll attach a simple example to this mail that executes the QT Plugins
FCode. To test it, do:
~/openbios $ make
~/openbios $ make rungui < device-example.fs
It will use the FCode binary built into the plugin to initialize the
virtual graphics hardware and output a character.
Next thing I'm going to work on is to finish the terminal emulator and
other support packages, then facing the client interface code to finally
boot an operating system
For the client interface it should make sense to reuse a lot of existing
code, i.e filesystem drivers (GRUB), elf booting (Filo, LinuxBIOS),
etc. by using the calling interfaces from forth to C and the other way round.
Stefan
-------------- next part --------------
: w at -le ( addr )
dup c@ swap
1+ c@ 8 << or
;
: test-tree
" dev /chosen" evaluate .properties
" /openprom" " selftest" execute-device-method
" dev /openprom" evaluate
.properties
;
: init-gfx
10 30 pci-l@
/n 8 = if
10 34 pci-l@
20 << or
then
dup 2+ w at -le +
0 byte-load
;
init-gfx
dev / ls
dev /pci ls
dev /pci/ATY,QTEMU words
.properties
" /pci/ATY,QTEMU" open-dev .
frame-buffer-adr .
: write-line ( char faddr )
over 1 and 0<> over 8 + c!
over 2 and 0<> over 7 + c!
over 4 and 0<> over 6 + c!
over 8 and 0<> over 5 + c!
over 10 and 0<> over 4 + c!
over 20 and 0<> over 3 + c!
over 40 and 0<> over 2 + c!
over 80 and 0<> over 1 + c!
2drop
;
: func
(romfont-8x16)
40 10 * +
10 0 do
dup i + c@
frame-buffer-adr
d# 20 d# 640 * + 20 +
i d# 640 * +
write-line
loop
;
func
\ bye
More information about the OpenBIOS
mailing list