Skip to content

Instantly share code, notes, and snippets.

View ao-kenji's full-sized avatar

Kenji Aoyama ao-kenji

View GitHub Profile

OpenBSD/amd64 での FUZIX ビルド環境構築ガイド

(2024/12/30版)

検証環境

  • OpenBSD/amd64 7.6-stable
  • 2024/12/29頃の FUZIX および Fuzix-Compiler-Kit のソースツリー

準備

@ao-kenji
ao-kenji / obsd-Fuzix-Compiler-Kit.diff
Created December 30, 2024 12:13
Patch for building Fuzix Compiler Kit on OpenBSD
diff --git a/CPP/main.c b/CPP/main.c
index 31b6235..75f76bf 100644
--- a/CPP/main.c
+++ b/CPP/main.c
@@ -22,7 +22,7 @@ char *token_txn(int);
void pr_indent(int);
void hash_line(void);
-#if defined(__linux__)
+#if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__)
@ao-kenji
ao-kenji / obsd-FUZIX.diff
Last active December 30, 2024 12:15
Patch for building FUZIX on OpenBSD
diff --git a/Kernel/platform/platform-z80pack/Makefile b/Kernel/platform/platform-z80pack/Makefile
index 5616e636a..b6d1b9eb6 100644
--- a/Kernel/platform/platform-z80pack/Makefile
+++ b/Kernel/platform/platform-z80pack/Makefile
@@ -30,6 +30,7 @@ clean:
image:
$(CROSS_LD) -b -C 0x0088 -S 0xF400 -X 0xE900 -f CLDBbXSs -o fuzix.bin \
+ -m fuzix.tmpmap \
crt0.o commonmem.o z80pack.o main.o \
@ao-kenji
ao-kenji / FUZIX-for-LUNA-XP-StartGuide.md
Last active December 13, 2024 14:28
FUZIX for LUNA XP: スタートガイド

FUZIX for LUNA XP:スタートガイド

Version 0.4 (NBUG例会 2024年12月版)

必要なもの

  • nono または実機で動く OpenBSD/luna88k または NetBSD/luna68k (以下、LUNAと書きます)
  • 以下のファイルを https://www.nk-home.net/~aoyama/tmp/fuzix/ に置いておきますので、LUNAに持っていってください。

| ファイル名 | サイズ | 内容 |

@ao-kenji
ao-kenji / mandelbrot.c
Created October 5, 2024 14:33
Mandelbrot ASCII art for FUZIX
/*
* ASCIIART: Mandelbrot set
* originally from https://kyo-ta04.github.io/memo/
* modified to run on FUZIX
*/
#include <stdio.h>
#include <time.h>
#define putch(a) putchar(a)
diff --git a/Kernel/platform/platform-sbcv2/Makefile b/Kernel/platform/platform-sbcv2/Makefile
index f5a7c7f8c..9dd246b72 100644
--- a/Kernel/platform/platform-sbcv2/Makefile
+++ b/Kernel/platform/platform-sbcv2/Makefile
@@ -60,6 +60,7 @@ clean:
#
image: bootblock
$(CROSS_LD) -b -C 0x0100 -S 0xF400 -f CLDBbXSs -o fuzix.bin \
+ -m fuzix.tmpmap \
crt0.o commonmem.o sbcv2.o ../../start.o \
@ao-kenji
ao-kenji / obsd-Fuzix-05.diff
Last active December 9, 2024 12:25
Experimental diff for building Fuzix 0.5 on z80pack onOpenBSD/amd64
diff --git a/Kernel/platform/platform-z80pack/Makefile b/Kernel/platform/platform-z80pack/Makefile
index 5616e636a..f53c23bc5 100644
--- a/Kernel/platform/platform-z80pack/Makefile
+++ b/Kernel/platform/platform-z80pack/Makefile
@@ -30,6 +30,7 @@ clean:
image:
$(CROSS_LD) -b -C 0x0088 -S 0xF400 -X 0xE900 -f CLDBbXSs -o fuzix.bin \
+ -m fuzix.tmpmap \
crt0.o commonmem.o z80pack.o main.o \
@ao-kenji
ao-kenji / obsd-Fuzix-Compiler-Kit.diff
Last active July 1, 2024 12:55
Experimental diff for building Fuzix-Compiler-Kit on OpenBSD/amd64
diff --git a/Makefile b/Makefile
index 2b2c860..15d3111 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+CC=cc
+
all: cc cc0 \
cc1.8080 cc1.z80 cc1.thread cc1.byte cc1.6502 \
cc1.65c816 cc1.z8 cc1.1802 cc1.6800 cc1.6809 \
@ao-kenji
ao-kenji / obsd-luna88k-uvm-percpu-cache.diff
Last active June 14, 2024 22:21
Experimental diff to enable uvm per-CPU cache on luna88k
Index: sys/arch/m88k/include/cpu.h
===================================================================
RCS file: /cvs/src/sys/arch/m88k/include/cpu.h,v
diff -u -r1.79 cpu.h
--- sys/arch/m88k/include/cpu.h 9 Jun 2024 21:15:29 -0000 1.79
+++ sys/arch/m88k/include/cpu.h 14 Jun 2024 22:17:58 -0000
@@ -64,6 +64,7 @@
#include <sys/queue.h>
#include <sys/sched.h>
#include <sys/srp.h>
diff --git a/Makefile b/Makefile
index 1f9f4e9..5ce482c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,8 @@ OBJS = nanotodon.o sbuf.o squeue.o utils.o config.o messages.o
# Use $XDG_CONFIG_HOME or ~/.config dir to save config files
CFLAGS += -g -DSUPPORT_XDG_BASE_DIR -D_GNU_SOURCE -D_BSD_SOURCE -D_NETBSD_SOURCE
+CFLAGS += -I/usr/local/include -Wno-format-security
+LDFLAGS += -L/usr/local/lib