Skip to content

Commit a8edf76

Browse files
committed
distrib/luna68k: add "build.sh live-image" support for luna68k
Using recently added "USE_MDBOOTPART" in Makefile.bootimage with MD rules. A generated live-image is confirmed working on nono 1.6.4 with LUNA's ROM: --- % nono-cli -V vmtype=luna -V prom-image=LUNAROM.DAT -V dipsw-autoboot=no -V dipsw-serial=yes -V hostcom-driver=stdio -V spc0-id6-image=hd,NetBSD-11.99.5-luna68k-live.img -V spc0-id6-writeignore=1 (PROM) Unknown PROM version (SCSIHD6) write is ignored Diagnostic Start.... 11.549'836'096 805b XP(HD647180) WriteInternalIO 53H(DERA) <- $07 (NOT IMPLEMENTED) 11.549'839'519 8060 XP(HD647180) WriteInternalIO 60H(IODRA) <- $50 (NOT IMPLEMENTED) 11.549'842'942 8065 XP(HD647180) WriteInternalIO 70H(DDRA) <- $70 (NOT IMPLEMENTED) 11.650'402'532 8528 XP(HD647180) WriteInternalIO 60H(IODRA) <- $20 (NOT IMPLEMENTED) 11.653'401'080 8bd1 XP(HD647180) ReadInternalIO 48H(T2CSR1) -> $ff (NOT IMPLEMENTED) 11.653'404'340 8bd6 XP(HD647180) WriteInternalIO 48H(T2CSR1) <- $ff (NOT IMPLEMENTED) 11.653'406'785 8bd9 XP(HD647180) ReadInternalIO 49H(T2CSR2) -> $ff (NOT IMPLEMENTED) 11.653'410'045 8bde XP(HD647180) WriteInternalIO 49H(T2CSR2) <- $ff (NOT IMPLEMENTED) No problems in hardware OMRON WS Monitor Ver4.25 (Thu May 16 11:54:02 1991) - 0x01000000 bytes of memory "BSD Monitor-mode" >k ctlr: dk drv: 0 par: c d fnam: vmunix boot >g SPC RESET CONDITION !! >x >> NetBSD/luna68k boot, Revision 1.12 (Sat Jan 17 07:19:27 UTC 2026) >> (based on Stinger ver 0.0 [Phase-31]) Machine model = LUNA-I Physical Memory = 0x1000000 (16 MB) sc0 at 0xe1000000: async, parity, ID 7 ID 6: NONO SCSIHD rev 0, 512 bytes/sect x 3145728 sectors le0: Am7990 LANCE Ethernet, mem at 0x71010000 le0: Ethernet address = 00:00:0a:02:4d:36 Press return to boot now, any other key for boot menu booting sd(6,0)netbsd - starting in 0 seconds. type "help" for help. boot> boot -s Booting sd(6,0)netbsd (howto 0x2) 2358892+97604 [336560+209989]=0x2dd6c8 [ 1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, [ 1.0000000] 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, [ 1.0000000] 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, [ 1.0000000] 2024, 2025, 2026 [ 1.0000000] The NetBSD Foundation, Inc. All rights reserved. [ 1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993 [ 1.0000000] The Regents of the University of California. All rights reserved. [ 1.0000000] NetBSD 11.99.5 (GENERIC) #0: Sat Jan 17 16:26:14 JST 2026 [ 1.0000000] tsutsui@proslim:/home/tsutsui/obj.luna68k/sys/arch/luna68k/compile/GENERIC [ 1.0000000] LUNA-I (MC68030 CPU+MMU, MC68881 FPU) :
1 parent 6e965e2 commit a8edf76

6 files changed

Lines changed: 92 additions & 1 deletion

File tree

distrib/luna68k/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# $NetBSD: Makefile,v 1.2 2025/09/23 20:12:07 rillig Exp $
1+
# $NetBSD: Makefile,v 1.3 2026/01/18 00:12:10 tsutsui Exp $
22

33
SUBDIR= ramdisk .WAIT instkernel .WAIT cdroms
4+
SUBDIR+= liveimage
45
TARGETS+= release
56

67
iso_image: .MAKE
78
${MAKEDIRTARGET} cdroms iso_image
89

10+
live_image: .MAKE
11+
${MAKEDIRTARGET} liveimage live_image
12+
913
.include <bsd.subdir.mk>

distrib/luna68k/liveimage/Makefile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# $NetBSD: Makefile,v 1.1 2026/01/18 00:12:11 tsutsui Exp $
2+
3+
LIVEIMGBASE= NetBSD-${DISTRIBVER}-luna68k-live # gives ${IMGBASE}.img
4+
5+
.include <bsd.own.mk>
6+
7+
LIVEIMAGEMB?= 1536 # < 2GB is preferred for SCSI emulators that use FAT32
8+
MDBOOTPARTMB?= 8 # as PART_BOOT in sysinst/arch/luna68k/md.h
9+
10+
USE_MBR= no
11+
USE_GPT= no
12+
USE_MDBOOTPART= yes
13+
USE_SUNLABEL= yes
14+
15+
DISKPROTO_IN= ${.CURDIR}/diskproto.in
16+
FSTAB_IN= ${.CURDIR}/fstab.in
17+
SPEC_EXTRA= ${.CURDIR}/spec.in
18+
19+
.include "${.CURDIR}/../../common/bootimage/Makefile.liveimage"
20+
21+
MDBOOTPARTFILES= ${WORKDIR}/usr/mdec/boot
22+
MDBOOTPARTMAKEFSOPTIONS= -t ffs -o version=0,bsize=4096,fsize=512,density=2048
23+
SPEC_BOOT= spec.boot
24+
CLEANFILES+= ${SPEC_BOOT}
25+
26+
${MDBOOTPARTFILES}: ${TARGETFS}
27+
# ${MDBOOTPARTFILES} are assumed extracted during to ${WORKDIR}
28+
# from binary sets during ${TARGETFS} image build
29+
30+
${WORKMDBOOTPART}: ${TARGETFS} ${MDBOOTPARTFILES}
31+
@echo create MD boot partition for bootstrap files...
32+
@${MKDIR} ${MKDIRPERM} ${WORKMDBOOTPARTDIR}
33+
rm -f ${SPEC_BOOT}
34+
cp ${.CURDIR}/spec.boot.in ${SPEC_BOOT}
35+
@echo Copying files for MD boot partition...
36+
.for f in ${MDBOOTPARTFILES}
37+
@if [ ! -f ${f} ]; then \
38+
echo "${f} in MDBOOTPARTFILES not found, aborting"; \
39+
false; \
40+
fi
41+
${INSTALL} ${COPY} -m 0644 ${f} ${WORKMDBOOTPARTDIR}
42+
echo "./$$(basename ${f}) type=file uname=root gname=wheel mode=0644" \
43+
>> ${SPEC_BOOT}
44+
.endfor
45+
${RM} -f ${WORKMDBOOTPART}
46+
${TOOL_MAKEFS} -M ${MDBOOTPARTMB}m -m ${MDBOOTPARTMB}m \
47+
-xx -F ${SPEC_BOOT} \
48+
-B ${TARGET_ENDIANNESS} \
49+
${MAKEFS_TIMESTAMP} \
50+
${MDBOOTPARTMAKEFSOPTIONS} \
51+
${WORKMDBOOTPART} ${WORKMDBOOTPARTDIR}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# $NetBSD: diskproto.in,v 1.1 2026/01/18 00:12:11 tsutsui Exp $
2+
type: SCSI
3+
disk: liveimage
4+
label:
5+
flags:
6+
bytes/sector: 512
7+
sectors/track: @@SECTORS@@
8+
tracks/cylinder: @@HEADS@@
9+
sectors/cylinder: @@SECPERCYLINDERS@@
10+
cylinders: @@CYLINDERS@@
11+
total sectors: @@IMAGESECTORS@@
12+
rpm: 3600
13+
interleave: 1
14+
trackskew: 0
15+
cylinderskew: 0
16+
headswitch: 0 # microseconds
17+
track-to-track seek: 0 # microseconds
18+
drivedata: 0
19+
20+
8 partitions:
21+
# size offset fstype [fsize bsize cpg/sgs]
22+
a: @@FSSECTORS@@ @@FSOFFSET@@ 4.2BSD 2048 16384 16
23+
b: @@SWAPSECTORS@@ @@SWAPOFFSET@@ swap
24+
c: @@IMAGESECTORS@@ 0 unused 0 0
25+
d: @@MDBOOTPARTSECTORS@@ @@MDBOOTPARTOFFSET@@ 4.2BSD 512 4096 16

distrib/luna68k/liveimage/fstab.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ROOT.a / ffs rw 1 1
2+
ROOT.b none none sw 0 0
3+
ROOT.d /boot ffs rw 1 2
4+
ptyfs /dev/pts ptyfs rw 0 0
5+
kernfs /kern kernfs rw,noauto 0 0
6+
procfs /proc procfs rw,noauto 0 0
7+
tmpfs /var/shm tmpfs rw,-m1777,-sram%25 0 0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# $NetBSD: spec.boot.in,v 1.1 2026/01/18 00:12:11 tsutsui Exp $
2+
. type=dir uname=root gname=wheel mode=0755

distrib/luna68k/liveimage/spec.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# $NetBSD: spec.in,v 1.1 2026/01/18 00:12:11 tsutsui Exp $
2+
./boot type=dir uname=root gname=wheel mode=0755

0 commit comments

Comments
 (0)