Skip to content

Commit

Permalink
Add 'buildimages.sh fast' for fast uncompressed builds for emulator t…
Browse files Browse the repository at this point in the history
…esting

Add dosbox.sh for PC-98 image testing
Fix qemu.sh for macOS
Enhance emu86.sh for use after buildimages.sh
  • Loading branch information
ghaerr committed Oct 31, 2024
1 parent 6e2bf76 commit a0398e7
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 11 deletions.
62 changes: 53 additions & 9 deletions buildimages.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#
# This script is used to build all ELKS images outside Github CI
# Usage: ./buildimages [fast|ibm]
# The 'fast' option skips initial make clean, pc98-1440 and ibm-all images uncompressed
set -x
set -e

Expand All @@ -22,41 +24,83 @@ build_pc98()
cp pc98-1232.config .config
make
mv image/fd1232.img image/fd1232-pc98.img
}

build_pc98_fast()
{
cleanup
cp pc98-1232-nc.config .config
make
mv image/fd1232.img image/fd1232-pc98.img
}

build_pc98_1440()
{
cleanup
cp pc98-1440.config .config
make
mv image/fd1440.img image/fd1440-pc98.img
}

# build 8018X image
build_8018x()
# build 8018X rom image
build_rom_8018x()
{
cleanup
cp 8018x.config .config
make
cp -p elks/arch/i86/boot/Image image/rom-8018x.bin
mv image/romfs.bin image/romfs-8018x.bin
}

# build 8088 rom image
build_rom_8088()
{
cleanup
cp emu86-rom-full.config .config
make
cp -p elks/arch/i86/boot/Image image/rom-8088.bin
mv image/romfs.bin image/romfs-8088.bin
}

# build IBM PC versions
build_ibm()
{
cleanup
cp ibmpc-1440.config .config
#cp ibmpc-1440-nc.config .config
make
}

build_ibm_fast()
{
cleanup
cp ibmpc-1440-nc.config .config
make
}

build_ibm_all()
{
cd image
make images
cd ..
}

# quick kernel-only and specific apps build for dosbox, emu86.sh and qemu.sh testing
if [ "$1" == "fast" ]; then
build_pc98_fast
build_rom_8088
build_ibm_fast
exit
fi

if [ "$1" == "ibm" ]; then
build_ibm_fast
exit
fi

# full (re)build including C library and all applications
make clean
build_ibm
build_pc98
build_8018x

cp ibmpc-1440.config .config
#cp ibmpc-1440-nc.config .config
cleanup
make
build_8088
build_ibm
build_ibm_all
17 changes: 17 additions & 0 deletions dosbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Helper to run PC98 images in DosBoxX (dosbox-x-sdl2)
#

# 1232k image from './buildimages.sh fast'
exec ./dosbox-x-sdl2 -set machine=pc98 -set "dosbox quit warning=false" -fastlaunch -c "boot image/fd1232-pc98.img"

# just-built 1232k image
#exec ./dosbox-x-sdl2 -set machine=pc98 -set "dosbox quit warning=false" -fastlaunch -c "boot image/fd1232.img"

# 1440k image
#exec ./dosbox-x-sdl2 -set machine=pc98 -set "dosbox quit warning=false" -fastlaunch -c "boot image/fd1440-pc98.img"

# 1440k IBM image
#exec ./dosbox-x-sdl2 -set "dosbox quit warning=false" -fastlaunch -c "boot image/fd1440.img"

# 2880k IBM image
#exec ./dosbox-x-sdl2 -set "dosbox quit warning=false" -fastlaunch -c "boot image/fd2880-fat.img"
5 changes: 5 additions & 0 deletions emu86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@

# For ELKS ROM Configuration:
# ELKS must be configured minimally with 'cp emu86-rom.config .config'
# or use './buildimages.sh fast'
# This uses headless console, HLT on idle, ROM filesystem.

# Kernel image @ segment 0xE000 (as 64K BIOS extension)
# Root filesystem @ segment 0x8000 (assumes 512K RAM & 512K ROM)

# 8088 version using emu-rom-full.config from './buildimages.sh fast'
exec emu86 -w 0xe0000 -f image/rom-8088.bin -w 0x80000 -f image/romfs-8088.bin ${1+"$@"}

# just built rom version using 'make'
exec emu86 -w 0xe0000 -f elks/arch/i86/boot/Image -w 0x80000 -f image/romfs.bin ${1+"$@"}

# For ELKS Full ROM Configuration:
Expand Down
1 change: 1 addition & 0 deletions image/Make.image
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,4 @@ romfs:
-rm -f romfs.devices
$(MAKE) -f Make.devices "MKDEV=echo >> romfs.devices"
mkromfs -d romfs.devices $(DESTDIR)
-rm -f romfs.devices
130 changes: 130 additions & 0 deletions pc98-1232-nc.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#
# Automatically generated by make menuconfig: don't edit.
#


#
# Kernel & Hardware
#


#
# System
#

# CONFIG_ARCH_IBMPC is not set
# CONFIG_ARCH_8018X is not set
CONFIG_ARCH_PC98=y

#
# Kernel settings
#

CONFIG_BOOTOPTS=y
# CONFIG_ASYNCIO is not set
CONFIG_CPU_USAGE=y
CONFIG_TIME_RTC_LOCALTIME=y
CONFIG_TIME_TZ="JST-9"
# CONFIG_TRACE is not set
# CONFIG_TIMER_INT0F is not set
# CONFIG_TIMER_INT1C is not set
CONFIG_FARTEXT_KERNEL=y

#
# Networking Support
#

CONFIG_SOCKET=y
# CONFIG_NANO is not set
CONFIG_INET=y
# CONFIG_UNIX is not set

#
# Filesystem Support
#

CONFIG_MINIX_FS=y
# CONFIG_ROMFS_FS is not set
CONFIG_FS_FAT=y
CONFIG_FS_EXTERNAL_BUFFER=y
CONFIG_FS_NR_EXT_BUFFERS=64
# CONFIG_FS_XMS_BUFFER is not set
CONFIG_EXEC_COMPRESS=y
CONFIG_EXEC_OS2=y
CONFIG_EXEC_MMODEL=y

#
# Drivers
#


#
# Block device drivers
#

CONFIG_BLK_DEV_BFD=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_TRACK_CACHE=y
# CONFIG_BLK_DEV_BFD_HARD is not set
CONFIG_BLK_DEV_BHD=y
# CONFIG_IDE_PROBE is not set
# CONFIG_BLK_DEV_RAM is not set
CONFIG_BLK_DEV_SSD_NONE=y
CONFIG_BLK_DEV_CHAR=y

#
# Character device drivers
#

CONFIG_CONSOLE_DIRECT=y
# CONFIG_CONSOLE_BIOS is not set
# CONFIG_CONSOLE_8018X is not set
# CONFIG_CONSOLE_HEADLESS is not set
# CONFIG_KEYBOARD_SCANCODE is not set
# CONFIG_CONSOLE_SERIAL is not set
CONFIG_EMUL_ANSI=y
# CONFIG_KEYMAP_BE is not set
# CONFIG_KEYMAP_DE is not set
# CONFIG_KEYMAP_DV is not set
# CONFIG_KEYMAP_ES is not set
# CONFIG_KEYMAP_FR is not set
# CONFIG_KEYMAP_IT is not set
# CONFIG_KEYMAP_SE is not set
# CONFIG_KEYMAP_UK is not set
CONFIG_KEYMAP_US=y
CONFIG_CHAR_DEV_RS=y
CONFIG_CHAR_DEV_LP=y
CONFIG_CHAR_DEV_MEM=y
CONFIG_PSEUDO_TTY=y

#
# Network device drivers
#

# CONFIG_ETH is not set

#
# Userland
#

CONFIG_APPS_BY_IMAGESZ=y
CONFIG_APPS_1232K=y
# CONFIG_APPS_FTRACE is not set
# CONFIG_APP_OTHER is not set
# CONFIG_APP_TEST is not set
# CONFIG_APP_MAN_PAGES is not set
# CONFIG_SYS_DEFSHELL_SASH is not set
# CONFIG_SYS_NO_BININIT is not set

#
# Target image
#

# CONFIG_IMG_MINIX is not set
CONFIG_IMG_FAT=y
# CONFIG_IMG_ROM is not set
CONFIG_IMG_FD1232=y
CONFIG_IMG_DEV=y
CONFIG_IMG_BOOT=y
# CONFIG_APPS_COMPRESS is not set
# CONFIG_IMG_EXTRA_IMAGES is not set
4 changes: 2 additions & 2 deletions qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ NET="-netdev user,id=mynet,$FWD -device ne2k_isa,irq=12,netdev=mynet"
# Enable PC-Speaker here:
#AUDIO="-audiodev pa,id=speaker -machine pcspk-audiodev=speaker"

UNAME=`uname -a`
UNAME=`uname`

# Determine display type ("Darwin" = OSX)
[ $UNAME != 'Darwin' ] && QDISPLAY="-display sdl"
[ "$UNAME" != 'Darwin' ] && QDISPLAY="-display sdl"

# Configure QEMU as pure ISA system

Expand Down

0 comments on commit a0398e7

Please sign in to comment.