Open Firmware 學習貼總匯

92 views
Skip to first unread message

胡松涛

unread,
May 24, 2011, 1:19:03 PM5/24/11
to cn...@googlegroups.com

詳細的整理在這裏:

什麽是Open Firmware?
Firmware, 韌體。
http://wenku.baidu.com/view/e904141eb7360b4c2e3f64f6.html
Open Firmware, 開放結構的韌體。 http://www.openfirmware.org/


馬上體驗Open Firmware?

ROM 方式:
下載: http://forth.foxani.com/files/emuofw.rom
執行:
qemu -L . -bios emuofw.rom -hda fat:.
意思是,用emuofw.rom替代原始qemu的rom, 用當前目錄為 hda

Floppy 方式:
下載: http://forth.foxani.com/files/floppy.img
執行:VirtualBox虛擬(VMware不行)
軟盤啟動。
更多配制參考:http://www.openfirmware.info/Building_OFW_to_Load_from_BIOS#Booting_OFW_from_VirtualBox

USB 方式:
文件: 附件ofw.c32
制作啟動usb(linux): syslinux 4.0版本以上
sudo umount /xxx/yourUSBDisk
syslinux /dev/sdb1
復制ofw.c32到usb盤。
設置bios,首先從usb盤啟動。
啟動:
啟動後,出現
boot:
輸入 ofw.c32 回車,會進入Forth系統。
自己從源碼Build?
http://www.openfirmware.info/Open_Firmware#Building_Different_Versions

Boot進入Open Firmware之後可以幹什麽?
試試幾個命令:

虛擬機裏面的磁盤鏡像
http://www.openfirmware.info/Building_OFW_for_QEMU#Hard_Disk_Images
ok .partitions c
ok dir c:\
如果您是從floppy.img啟動的,請用:
ok .partitions a
ok dir a:\
Usb盤啟動,還沒測試出來。

串口終端: 未測試
http://www.openfirmware.info/Building_OFW_for_QEMU#Serial_Console
網絡: 尚未測試成功
http://www.openfirmware.info/Building_OFW_for_QEMU#Networking
圖形: 由于圖形文件內的一些字調用無法確認,測試未成功
http://www.openfirmware.info/Building_OFW_for_QEMU#Graphics
聲音: 成功
http://www.openfirmware.info/Building_OFW_for_QEMU#Sound

更全的命令參考:
http://firmworks.com/QuickRef.html
比較詳細的Mac文章參考(第四章):
http://forth.foxani.com/files/Mac.OS.X.Internals.-.A.Systems.Approach.chm



作者回信告知OFW中Forth的編程方式:

教程: http://wiki.laptop.org/go/Forth_Lessons 翔實有趣。

第九章開始講述Open Firmware。

Open Firmware device drivers are object oriented. Before you can use
them, you must select the "instance" of the object that you wish to use.
The reason for this complexity is so that you can use the same device
driver for multiple instances of a device - for example you might have two
different disks that use the same driver.

The terminal emulator package is used by the screen object, so you must
select the screen context before you can use terminal emulator methods.
The "stdout" variable contains a pointer to an already-open screen object,
so you can select it by writing

ok stdout @ iselect

After you do that, you can write, for example:

ok foreground-color .
f
ok 2 to foreground-color

which should change the text color to green.

更進一步,寫應用程式:

推薦實踐文檔(recommended practice documents):
http://www.openfirmware.org/1275/practice/
延伸文檔(the Open Firmware Working Group proposal index)
http://www.openfirmware.org/1275/proposals/index.html
退出/關閉: bye 命令
如果是Usb盤,會直接關機。 虛擬機可以直接關閉窗口。



參考:
源碼查看: http://tracker.coreboot.org/trac/openfirmware/browser
源碼svn: svn://openfirmware.info/openfirmware/
丁陳老師的《eForth研讨会报告》

--
Hu Songtao
works as an English Teacher in weekends
Skype: idisblueflash
Beijing, China
ofw.c32
eforth固件.doc

王晓杰

unread,
May 29, 2011, 2:58:35 AM5/29/11
to cn...@googlegroups.com
fox, 看得出你在ofw上做了大量的工作。我会一直关注的。



--
You received this message because you are subscribed to the Google
Groups "Forth中国社区" group.
To post to this group, send email to Cn...@googlegroups.com
To unsubscribe from this group, send email to
CnFig+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/CnFig?hl=zh-CN

胡松涛

unread,
May 29, 2011, 4:43:11 AM5/29/11
to cn...@googlegroups.com
在 Sun, 29 May 2011 10:58:35 +0800,王晓杰 <yoyof...@gmail.com> 写道:

> fox, 看得出你在ofw上做了大量的工作。我会一直关注的。

只是作好笔记, 备用啦.

--
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
Reply all
Reply to author
Forward
0 new messages