Encode boot image as integers instead of string
Hex escapes caused another mysterious character encoding problem with Minix clang.
This commit is contained in:
parent
ad4ef08080
commit
43515226f4
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
(define (dump-buffers-as-c-literal . bufs)
|
||||
(display "unsigned char boot_image[] = \"")
|
||||
(display "unsigned char boot_image[] = {")
|
||||
(let loop-bufs ((bufs bufs))
|
||||
(if (not (null? bufs))
|
||||
(begin (let ((buf (car bufs)))
|
||||
|
@ -7,10 +7,11 @@
|
|||
(let ((char (read-u8 buf)))
|
||||
(if (not (io.eof? buf))
|
||||
(let ((code (+ char 0)))
|
||||
(if (= 0 (mod i 16)) (display "\"\n\""))
|
||||
(display "\\x")
|
||||
(if (= 0 (mod i 8)) (display "\n"))
|
||||
(display "0x")
|
||||
(if (< code #x10) (display "0"))
|
||||
(display (number->string code 16))
|
||||
(display ",")
|
||||
(loop-buf-bytes (+ i 1)))))))
|
||||
(loop-bufs (cdr bufs)))))
|
||||
(display "\";\n"))
|
||||
(display "};\n"))
|
||||
|
|
Loading…
Reference in New Issue