スタート低レイヤー #6 発表資料(未完)
COM(シリアルポート)版の起動ディスク(boot-com1~5.fs)
http://ftp.jp.netbsd.org/pub/NetBSD/NetBSD-6.0.1/i386/installation/floppy/
VRAMのエミュレートが面倒なのでシリアルポート版を使用
build.sh release
で作られる個所をmaster_qさんに教えていただきました。
kern/vnode_if.c | |
=============== | |
int | |
VOP_WRITE(struct vnode *vp, | |
struct uio *uio, | |
int ioflag, | |
kauth_cred_t cred) | |
{ | |
int error; |
#include <stdio.h> | |
int main() { | |
// 10バイトのファイルを作成 | |
char a[10] = {0}; | |
FILE *f = fopen("test", "wb"); | |
fwrite(a, 1, sizeof(a), f); | |
fclose(f); | |
f = fopen("test", "r+b"); |
COM(シリアルポート)版の起動ディスク(boot-com1~5.fs)
http://ftp.jp.netbsd.org/pub/NetBSD/NetBSD-6.0.1/i386/installation/floppy/
VRAMのエミュレートが面倒なのでシリアルポート版を使用
build.sh release
で作られる個所をmaster_qさんに教えていただきました。
let aout = System.IO.File.ReadAllBytes "../../write-3.out" | |
let read16 (a:byte[]) i = ((int a.[i + 1]) <<< 8) ||| (int a.[i]) | |
let tsize = read16 aout 2 | |
let dsize = read16 aout 4 | |
printfn "tsize = %04x, dsize = %04x" tsize dsize | |
let mem = aout.[16 .. 16 + tsize + dsize - 1] | |
let mutable i = 0 | |
let show len = | |
printf "%04x: " i | |
for j in 0 .. 5 do |
open System | |
let rec loop () = | |
let line = Console.ReadLine () | |
if line <> null then | |
if line.Length > 60 then | |
let mne = line.[60..].Split(' ').[0] | |
printfn "%s %s:%s" line.[0..23] line.[40..43] mne | |
loop () | |
loop () |
int global = 10; | |
void null() | |
{ | |
return; | |
} | |
int return_zero() | |
{ | |
return 0; |
$ cat sbrk.c | |
#include <stdio.h> | |
#include <unistd.h> | |
int main() { | |
printf("%p\n", sbrk(0)); | |
printf("%p\n", sbrk(0)); | |
return 0; | |
} | |
---- |
#include <windows.h> | |
#include <stdio.h> | |
#include <string.h> | |
void align(FILE *f, int size) { | |
int pos = ftell(f); | |
int aligned = (pos + size - 1) / size * size; | |
for (; pos < aligned; ++pos) { | |
fwrite("\0", 1, 1, f); | |
} |
let bin = System.IO.File.ReadAllBytes "../../cc" | |
let mutable i = 0 | |
let show len asm = | |
printf "%08X " i | |
for j = 0 to len - 1 do | |
printf "%02X" bin.[i + j] | |
for j = len to 8 do | |
printf " " | |
printfn "%s" asm | |
i <- i + len |
// This file is in the public domain. | |
#r "System" | |
#r "System.Drawing" | |
#r "System.Windows.Forms" | |
open System | |
open System.IO | |
open System.Text | |
open System.Drawing |