[openfirmware] [commit] r2381 - cpu/x86/pc/neptune/build

repository service svn at openfirmware.info
Sat Jul 16 14:13:27 CEST 2011


Author: wmb
Date: Sat Jul 16 14:13:27 2011
New Revision: 2381
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2381

Log:
Checked in atomrom.bth

Added:
   cpu/x86/pc/neptune/build/atomrom.bth

Added: cpu/x86/pc/neptune/build/atomrom.bth
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ cpu/x86/pc/neptune/build/atomrom.bth	Sat Jul 16 14:13:27 2011	(r2381)
@@ -0,0 +1,26 @@
+purpose: Add CRC to atomic.rom
+
+command: &builder &this
+
+build-now
+
+fload ${BP}/forth/lib/crc32.fth
+
+h# 80000 constant romsize
+
+writing atomrom.rom
+   " atomic.rom" $add-file
+
+   /l buffer: crcbuf
+
+   romsize buffer: filebuf
+   0 ofd @ fseek
+
+   \ Read the entire image, compute the CRC, and store it h# 30 from the end
+   filebuf romsize ofd @ fgets romsize <> abort" Can't read back image"
+   0 crctab  filebuf romsize  ($crc)  crcbuf !
+
+   romsize h# 30 - ofd @ fseek
+   crcbuf /l ofd @ fputs
+
+ofd @ fclose



More information about the openfirmware mailing list