You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
(26) |
Aug
(23) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Lawrence S. <ljs...@us...> - 2020-09-20 00:43:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via c8f550bcfd4b0a200ba740933869c3a533b1fcc9 (commit) from 9e04dfc35a091e80929d6158cda53d7c804c5f30 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c8f550bcfd4b0a200ba740933869c3a533b1fcc9 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 20:43:12 2020 -0400 Don't build naomibintool or naominetboot when not building for NAOMI. ----------------------------------------------------------------------- Summary of changes: .gitignore | 1 + utils/Makefile | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b7e6fb3..f9ade36 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ utils/dcbumpgen/dcbumpgen utils/scramble/scramble utils/makeip/makeip utils/naomibintool/naomibintool +utils/naominetboot/naominetboot examples/dreamcast/basic/exec/romdisk/sub.bin examples/dreamcast/kgl/basic/vq/fruit.vq examples/dreamcast/conio/adventure/data.c diff --git a/utils/Makefile b/utils/Makefile index d5012a9..c635e77 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,11 +1,14 @@ # KallistiOS ##version## # # utils/Makefile -# (c)2001 Dan Potter +# Copyright (C) 2001 Dan Potter # -DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip naomibintool \ - naominetboot +DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip + +ifeq ($(KOS_SUBARCH), naomi) + DIRS += naomibintool naominetboot +endif # Ok for these to fail atm... @@ -14,5 +17,3 @@ all: clean: for i in $(DIRS); do $(KOS_MAKE) -C $$i clean; done - - hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-19 23:29:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 9e04dfc35a091e80929d6158cda53d7c804c5f30 (commit) via 224dbb559a7e90b8cb003f7575ae562038534418 (commit) via 099fd94740dfc20da3f1daf621bb474101d53980 (commit) via 3b9c14871991f13034a1fbadb43c62bd69d9372d (commit) via 75391ea0b8cebd429c100bf4b6bd145302d7b7e6 (commit) via f91ddef9c87ea4883a8113c3a437c56e1290f7e6 (commit) via cc01c36133be2db3b3072d681039aca5ca20bac0 (commit) via 547f9729818f3a39df6de6e6e19e6f641ebd0773 (commit) via 58911457d200517e12ff51b3e4f9f7ca2049ed0c (commit) via 6f44478f01f7ed4c562da44b7fa9e27de8205a6d (commit) via dfe683ad6cd627ad95d67b62f482ed7e1b3983ea (commit) via a4077367991ad58a9f44a78c331cb65d67a2d7fa (commit) from a9d0ae1cc06071469ba8a40480d2ca7f5e2b73e2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9e04dfc35a091e80929d6158cda53d7c804c5f30 Merge: a9d0ae1 224dbb5 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:28:27 2020 -0400 Merge pull request #46 from sizious/dc-chain-upgrade Major dc-chain updates. commit 224dbb559a7e90b8cb003f7575ae562038534418 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:27:18 2020 -0400 Update mingw/mingw.md Fix canonical repository locations. commit 099fd94740dfc20da3f1daf621bb474101d53980 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:26:37 2020 -0400 Update mingw/mingw-w64.md Fix canonical repository locations. commit 3b9c14871991f13034a1fbadb43c62bd69d9372d Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:25:41 2020 -0400 Update macos/README.md Fix canonical repository locations. commit 75391ea0b8cebd429c100bf4b6bd145302d7b7e6 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:24:59 2020 -0400 Update linux/debian.md Fix canonical repository locations. commit f91ddef9c87ea4883a8113c3a437c56e1290f7e6 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:24:12 2020 -0400 Update linux/alpine.md Fix canonical repository locations. commit cc01c36133be2db3b3072d681039aca5ca20bac0 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:23:28 2020 -0400 Update cygwin/README.md Fix canonical repository locations. commit 547f9729818f3a39df6de6e6e19e6f641ebd0773 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 19:22:38 2020 -0400 Fix repository location in bsd/README.md The sourceforge repositories are still the canonical locations for KOS and kos-ports. commit 58911457d200517e12ff51b3e4f9f7ca2049ed0c Author: SiZiOUS <si...@gm...> Date: Mon Aug 31 21:50:49 2020 +0200 Removing dcload/dc-tool part from documentation commit 6f44478f01f7ed4c562da44b7fa9e27de8205a6d Author: SiZiOUS <si...@gm...> Date: Mon Aug 31 21:41:06 2020 +0200 Adding missing critical scripts. commit dfe683ad6cd627ad95d67b62f482ed7e1b3983ea Author: SiZiOUS <si...@gm...> Date: Mon Aug 31 21:40:26 2020 +0200 Adding missing patches. commit a4077367991ad58a9f44a78c331cb65d67a2d7fa Author: SiZiOUS <si...@gm...> Date: Mon Aug 31 10:47:22 2020 +0200 Major upgrade of dc-chain utility. This version was completely revamped in order to work out-of-the box under several OS/environments, including (but not limited to): - BSD - GNU/Linux - macOS (including modern macOS versions, e.g. Catalina 10.15.6) - Windows (including MinGW/MSYS, MinGW-w64/MSYS2, Cygwin and WSL) All the configuration is located in the config.mk file; no need to update other files anymore. ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/.gitignore | 10 + utils/dc-chain/00PATCHES | 21 -- utils/dc-chain/00README | 33 -- utils/dc-chain/Makefile | 352 ++------------------- utils/dc-chain/README.md | 286 +++++++++++++++++ utils/dc-chain/cleanup.sh | 185 +++++++---- utils/dc-chain/config.mk | 147 +++++++++ utils/dc-chain/doc/CONTRIBUTORS.md | 19 ++ utils/dc-chain/doc/README.md | 16 + utils/dc-chain/doc/bsd/README.md | 135 ++++++++ utils/dc-chain/doc/cygwin/README.md | 150 +++++++++ utils/dc-chain/doc/linux/README.md | 7 + utils/dc-chain/doc/linux/alpine.md | 121 +++++++ utils/dc-chain/doc/linux/debian.md | 121 +++++++ utils/dc-chain/doc/macos/README.md | 149 +++++++++ utils/dc-chain/doc/mingw/README.md | 30 ++ utils/dc-chain/doc/mingw/mingw-w64.md | 174 ++++++++++ utils/dc-chain/doc/mingw/mingw.md | 248 +++++++++++++++ .../doc/mingw/packages/fixup-sh4-newlib.sh | 22 ++ .../mingw/msysCORE-1.0.18-1-heap-patch-20140117.7z | Bin 0 -> 4552241 bytes utils/dc-chain/docker/README.md | 28 ++ utils/dc-chain/docker/stable/Dockerfile | 36 +++ utils/dc-chain/download.sh | 149 +++++---- utils/dc-chain/patches/README.md | 36 +++ .../{gcc-4.7.4-kos.diff => gcc-4.7.3-kos.diff} | 74 ++--- .../patches/i686-pc-mingw32/binutils-2.31.1.diff | 13 + .../patches/i686-pc-mingw32/binutils-2.34.diff | 30 ++ .../patches/i686-pc-mingw32/gdb-7.12.1.diff | 33 ++ .../dc-chain/patches/i686-pc-mingw32/gdb-8.2.diff | 27 ++ .../patches/i686-pc-mingw32/gdb-8.3.1.diff | 131 ++++++++ .../dc-chain/patches/i686-pc-mingw32/gdb-9.1.diff | 19 ++ .../dc-chain/patches/i686-pc-mingw32/gdb-9.2.diff | 19 ++ utils/dc-chain/scripts/banner-variables.mk | 2 + utils/dc-chain/scripts/banner.mk | 11 + utils/dc-chain/scripts/binutils.mk | 52 +++ utils/dc-chain/scripts/build.mk | 64 ++++ utils/dc-chain/scripts/clean.mk | 29 ++ utils/dc-chain/scripts/common.sh | 118 +++++++ utils/dc-chain/scripts/gcc-pass1.mk | 32 ++ utils/dc-chain/scripts/gcc-pass2.mk | 31 ++ utils/dc-chain/scripts/gdb.mk | 86 +++++ utils/dc-chain/scripts/host-detect.mk | 85 +++++ utils/dc-chain/scripts/init.mk | 125 ++++++++ utils/dc-chain/scripts/insight.mk | 59 ++++ utils/dc-chain/scripts/logdir.mk | 9 + utils/dc-chain/scripts/newlib.mk | 62 ++++ utils/dc-chain/scripts/options.mk | 26 ++ utils/dc-chain/scripts/patch.mk | 82 +++++ utils/dc-chain/scripts/phony.mk | 14 + utils/dc-chain/scripts/variables.mk | 51 +++ utils/dc-chain/unpack.sh | 159 ++++++---- 51 files changed, 3303 insertions(+), 615 deletions(-) create mode 100644 utils/dc-chain/.gitignore delete mode 100644 utils/dc-chain/00PATCHES delete mode 100644 utils/dc-chain/00README create mode 100644 utils/dc-chain/README.md create mode 100644 utils/dc-chain/config.mk create mode 100644 utils/dc-chain/doc/CONTRIBUTORS.md create mode 100644 utils/dc-chain/doc/README.md create mode 100644 utils/dc-chain/doc/bsd/README.md create mode 100644 utils/dc-chain/doc/cygwin/README.md create mode 100644 utils/dc-chain/doc/linux/README.md create mode 100644 utils/dc-chain/doc/linux/alpine.md create mode 100644 utils/dc-chain/doc/linux/debian.md create mode 100644 utils/dc-chain/doc/macos/README.md create mode 100644 utils/dc-chain/doc/mingw/README.md create mode 100644 utils/dc-chain/doc/mingw/mingw-w64.md create mode 100644 utils/dc-chain/doc/mingw/mingw.md create mode 100644 utils/dc-chain/doc/mingw/packages/fixup-sh4-newlib.sh create mode 100644 utils/dc-chain/doc/mingw/packages/mingw/msysCORE-1.0.18-1-heap-patch-20140117.7z create mode 100644 utils/dc-chain/docker/README.md create mode 100644 utils/dc-chain/docker/stable/Dockerfile create mode 100644 utils/dc-chain/patches/README.md copy utils/dc-chain/patches/{gcc-4.7.4-kos.diff => gcc-4.7.3-kos.diff} (95%) create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/binutils-2.31.1.diff create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/binutils-2.34.diff create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/gdb-7.12.1.diff create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/gdb-8.2.diff create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/gdb-8.3.1.diff create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/gdb-9.1.diff create mode 100644 utils/dc-chain/patches/i686-pc-mingw32/gdb-9.2.diff create mode 100644 utils/dc-chain/scripts/banner-variables.mk create mode 100644 utils/dc-chain/scripts/banner.mk create mode 100644 utils/dc-chain/scripts/binutils.mk create mode 100644 utils/dc-chain/scripts/build.mk create mode 100644 utils/dc-chain/scripts/clean.mk create mode 100755 utils/dc-chain/scripts/common.sh create mode 100644 utils/dc-chain/scripts/gcc-pass1.mk create mode 100644 utils/dc-chain/scripts/gcc-pass2.mk create mode 100644 utils/dc-chain/scripts/gdb.mk create mode 100644 utils/dc-chain/scripts/host-detect.mk create mode 100644 utils/dc-chain/scripts/init.mk create mode 100644 utils/dc-chain/scripts/insight.mk create mode 100644 utils/dc-chain/scripts/logdir.mk create mode 100644 utils/dc-chain/scripts/newlib.mk create mode 100644 utils/dc-chain/scripts/options.mk create mode 100644 utils/dc-chain/scripts/patch.mk create mode 100644 utils/dc-chain/scripts/phony.mk create mode 100644 utils/dc-chain/scripts/variables.mk diff --git a/utils/dc-chain/.gitignore b/utils/dc-chain/.gitignore new file mode 100644 index 0000000..01041b6 --- /dev/null +++ b/utils/dc-chain/.gitignore @@ -0,0 +1,10 @@ +logs +*.tar.* +binutils-* +gcc-* +newlib-* +gdb-* +insight-* +build-* +*.stamp +config.guess diff --git a/utils/dc-chain/00PATCHES b/utils/dc-chain/00PATCHES deleted file mode 100644 index 410a35b..0000000 --- a/utils/dc-chain/00PATCHES +++ /dev/null @@ -1,21 +0,0 @@ -gcc-3.4.6-diff: -- Defines SUPPORT_WEAK 0 in config/sh/kos.h so that pthreads will not create - weak symbols (GNU ld does not extract weak symbols from archives). -- Do not build m2/m2e/m4-single/m4 by default. Should be unnecessary once - we have a sh-kos-elf target. -- Adds config/sh/kos.h to config.gcc. Note: this is under sh-elf-unknown. - Once we have a sh-kos-elf target, that should be corrected. -- Add sh4/atomicity.h stub, not currently used. Requires addition of spinlock - or interrupt disable/enable code. Currently we use the generic atomicity - functions, which use pthreads (slow). -- Correct bug (?) in config/generic/atomicity.h (_GLIBCXX_ macros undefined). -- Add sh-unknown-elf defines to libstdc++/crossconfig.m4 -- this was done by - default (accident?) prior to 3.4. - -Generic newlib fixups (applied directly after newlib is installed): - cp $(kos_base)/include/pthread.h $(newlib_inc) # KOS pthread.h is modified - cp $(kos_base)/include/sys/_pthread.h $(newlib_inc)/sys # to define _POSIX_THREADS - cp $(kos_base)/include/sys/sched.h $(newlib_inc)/sys # pthreads to kthreads mapping - ln -nsf $(kos_base)/include/kos $(newlib_inc) # so KOS includes are available as kos/file.h - ln -nsf $(kos_base)/kernel/arch/dreamcast/include/arch $(newlib_inc) # kos/thread.h requires arch/arch.h - ln -nsf $(kos_base)/kernel/arch/dreamcast/include/dc $(newlib_inc) # arch/arch.h requires dc/video.h diff --git a/utils/dc-chain/00README b/utils/dc-chain/00README deleted file mode 100644 index 7f4e257..0000000 --- a/utils/dc-chain/00README +++ /dev/null @@ -1,33 +0,0 @@ -dc-chain 0.3 ------------- - -This package contains a Makefile which both simplifies building the Dreamcast -toolchain, and gives you substantial control. - -On the minimum hassle side, 'make' will patch everything (using patches/*.diff) -and build both the sh and arm toolchains. 'make erase=1' will erase the build -directories as they become safe to delete, to save space. And as for a more -complex example, 'make patch-gcc build-sh4-gcc-pass1 thread_model=single' will -build a patched, single-threaded sh4 gcc pass 1 compiler. Please see the -comments at the top of the Makefile for more options. - -Before you start, change the variables in the User Configuration section to -match your environment. They can be overridden at the command line as well. - -Then untar your binutils, gcc-core, and optionally newlib and gcc-g++ -distributions into this directory (or copy Makefile and patches/ into your -build directory.) Also, ensure the KOS distribution is unpacked, and set -its path in the Makefile, because some KOS includes are copied over to newlib. - -Finally, run make. If anything goes wrong, check the output in logs/. - -Some patches are included in this package as well. There are several different -versions provided for GCC and Newlib. The most well tested combination is -GCC 4.7.4 with Newlib 2.0.0, but there are also newer possibilities that are in -testing (GCC 9.3.0 with Newlib 3.3.0). - -You should not attempt to spawn multiple jobs with make. Using "make -j2" or any -other number after the -j will probably break things. There is however now an -option inside the Makefile to set the number of jobs for the building phases. -Set the makejobs variable in the Makefile to whatever you would normally feel -the need to use on the command line, and it will do the right thing. diff --git a/utils/dc-chain/Makefile b/utils/dc-chain/Makefile index b0ccf8a..09c1ac5 100644 --- a/utils/dc-chain/Makefile +++ b/utils/dc-chain/Makefile @@ -1,358 +1,66 @@ -# Dreamcast toolchain makefile by Jim Ursetto -# adapted from Stalin's build script version 0.3 +# Sega Dreamcast Toolchains Maker (dc-chain) +# This file is part of KallistiOS. # -# Interesting parameters: -# erase=0|1 Erase build directories on the fly to save space -# thread_model=single|kos Set gcc threading model -# verbose=0|1 Display -# makejobs=-jn Set the number of jobs for calls to make to n +# Created by Jim Ursetto (2004) +# Initially adapted from Stalin's build script version 0.3. # -# Interesting targets (you can 'make' any of these): -# all: patch build -# patch: patch-gcc patch-newlib patch-kos -# build: build-sh4 build-arm -# build-sh4: build-sh4-binutils build-sh4-gcc -# build-arm: build-arm-binutils build-arm-gcc -# build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2 -# build-arm-gcc: build-arm-gcc-pass1 -# build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib -# gdb -# insight -# User configuration -sh_target=sh-elf -arm_target=arm-eabi -sh_prefix := /opt/toolchains/dc/$(sh_target) -arm_prefix := /opt/toolchains/dc/$(arm_target) -# kos_root: KOS Git root (contains kos/ and kos-ports/) -kos_root=$(CURDIR)/../../.. -# kos_base: equivalent of KOS_BASE (contains include/ and kernel/) -kos_base=$(CURDIR)/../.. -sh_binutils_ver=2.34 -sh_gcc_ver=9.3.0 -newlib_ver=3.3.0 -gdb_ver=9.1 -insight_ver=6.8-1 - -# The ARM version of binutils/gcc is separated out as the -# particular CPU versions we need may not be available in -# newer versions of GCC. -arm_binutils_ver=2.34 -arm_gcc_ver=8.4.0 - -# With GCC 4.x versions and higher, the patches provide a kos thread model, -# so you should use it. With 3.4.6, you probably want posix here. If you -# really don't want threading support for C++ (or Objective C/Objective C++), -# you can set this to single (why you would is beyond me, though). -thread_model=kos -erase=1 -verbose=1 - -# Set this value to -jn where n is the number of jobs you want to run with make. -# If you only want one job, just set this to nothing (i.e, "makejobs="). -# Tracking down problems with multiple make jobs is much more difficult than -# with just one running at a time. So, if you run into trouble, then you should -# clear this variable and try again with just one job running. -makejobs=-j2 - -# Set the languages to build for pass 2 of building gcc for sh-elf. The default -# here is to build C, C++, Objective C, and Objective C++. You may want to take -# out the latter two if you're not worried about them and/or you're short on -# hard drive space. -pass2_languages=c,c++,objc,obj-c++ +# Please edit 'config.mk' to customize your 'dc-chain' setup. +# -# Change this if you don't have Bash installed in /bin -SHELL = /bin/bash +# Display startup banner +include scripts/banner-variables.mk +include scripts/banner.mk -# GCC compiles fine with clang, but only if we use libstdc++ instead of libc++. -UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Darwin) - ifneq ($(shell $(CXX) --version | grep clang),) - CXX := "$(CXX) -stdlib=libstdc++" - endif -endif +# User configuration +include config.mk -# Catch all... -ifeq ($(CXX),) - CXX := g++ -endif +# Detect host machine +include scripts/host-detect.mk +# Initialization rules +include scripts/init.mk # Makefile variables -install=$(prefix)/bin -pwd := $(shell pwd) -patches := $(pwd)/patches -logdir := $(pwd)/logs -PATH := $(sh_prefix)/bin:$(arm_prefix)/bin:$(PATH) -binutils_dir=binutils-$(binutils_ver) -gcc_dir=gcc-$(sh_gcc_ver) -newlib_dir=newlib-$(newlib_ver) +include scripts/variables.mk all: patch build # ---- patch {{{ -binutils_patches := $(wildcard $(patches)/binutils-$(binutils_ver)*.diff) -gcc_patches := $(wildcard $(patches)/gcc-$(sh_gcc_ver)*.diff) -newlib_patches := $(wildcard $(patches)/newlib-$(newlib_ver)*.diff) -kos_patches := $(wildcard $(patches)/kos-*.diff) - -patch_targets=patch-binutils patch-gcc patch-newlib patch-kos - -patch: $(patch_targets) -patch-binutils: $(binutils_patches) -patch-gcc: $(gcc_patches) -patch-newlib: $(newlib_patches) -patch-kos: $(kos_patches) - -$(newlib_patches): - patch -N -d $(newlib_dir) -p1 < $@ -$(binutils_patches): - patch -N -d $(binutils_dir) -p1 < $@ - -$(gcc_patches): - patch -N -d $(gcc_dir) -p1 < $@ - -$(kos_patches): - patch -N -d $(kos_root) -p1 < $@ +include scripts/patch.mk # ---- }}} # ---- build {{{ -build: build-sh4 build-arm -build-sh4: build-sh4-binutils build-sh4-gcc -build-arm: build-arm-binutils build-arm-gcc -build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2 -build-arm-gcc: build-arm-gcc-pass1 - $(clean_arm_hack) -build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib - -# Ensure that, no matter where we enter, prefix and target are set correctly. -build_sh4_targets=build-sh4-binutils build-sh4-gcc build-sh4-gcc-pass1 build-sh4-newlib build-sh4-newlib-only build-sh4-gcc-pass2 -build_arm_targets=build-arm-binutils build-arm-gcc build-arm-gcc-pass1 -$(build_sh4_targets): prefix = $(sh_prefix) -$(build_sh4_targets): target = $(sh_target) -$(build_sh4_targets): extra_configure_args = --with-multilib-list=m4-single-only --with-endian=little --with-cpu=m4-single-only -$(build_sh4_targets): gcc_ver = $(sh_gcc_ver) -$(build_sh4_targets): binutils_ver = $(sh_binutils_ver) -$(build_arm_targets): prefix = $(arm_prefix) -$(build_arm_targets): target = $(arm_target) -$(build_arm_targets): extra_configure_args = --with-arch=armv4 --with-mode=arm --disable-multilib -$(build_arm_targets): gcc_ver = $(arm_gcc_ver) -$(build_arm_targets): binutils_ver = $(arm_binutils_ver) - -# To avoid code repetition, we use the same commands for both -# architectures. But we can't create a single target called -# build-binutils for both sh4 and arm, because phony targets -# can't be run multiple times. So we create multiple targets. -build_binutils = build-sh4-binutils build-arm-binutils -build_gcc_pass1 = build-sh4-gcc-pass1 build-arm-gcc-pass1 -build_newlib = build-sh4-newlib-only -build_gcc_pass2 = build-sh4-gcc-pass2 - -# Here we use the essentially same code for multiple targets, -# differing only by the current state of the variables below. -$(build_binutils): build = build-binutils-$(target)-$(binutils_ver) -$(build_binutils): src_dir = binutils-$(binutils_ver) -$(build_binutils): log = $(logdir)/$(build).log -$(build_binutils): logdir - @echo "+++ Building $(src_dir) to $(build)..." - -mkdir -p $(build) - > $(log) - cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) --disable-werror CXX=$(CXX) $(to_log) - $(MAKE) $(makejobs) -C $(build) DESTDIR=$(DESTDIR) $(to_log) - $(MAKE) -C $(build) install DESTDIR=$(DESTDIR) $(to_log) - $(clean_up) +include scripts/build.mk -$(build_gcc_pass1) $(build_gcc_pass2): build = build-gcc-$(target)-$(gcc_ver) -$(build_gcc_pass1) $(build_gcc_pass2): src_dir = gcc-$(gcc_ver) -$(build_gcc_pass1): log = $(logdir)/$(build)-pass1.log -$(build_gcc_pass1): logdir - @echo "+++ Building $(src_dir) to $(build) (pass 1)..." - -mkdir -p $(build) - > $(log) - cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) --without-headers --with-newlib --enable-languages=c --disable-libssp --disable-tls $(extra_configure_args) CXX=$(CXX) $(to_log) - $(MAKE) $(makejobs) -C $(build) DESTDIR=$(DESTDIR) $(to_log) - $(MAKE) -C $(build) install-strip DESTDIR=$(DESTDIR) $(to_log) - -$(build_newlib): build = build-newlib-$(target)-$(newlib_ver) -$(build_newlib): src_dir = newlib-$(newlib_ver) -$(build_newlib): log = $(logdir)/$(build).log -$(build_newlib): logdir - @echo "+++ Building $(src_dir) to $(build)..." - -mkdir -p $(build) - > $(log) - cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) $(extra_configure_args) $(to_log) - $(MAKE) $(makejobs) -C $(build) DESTDIR=$(DESTDIR) $(to_log) - $(MAKE) -C $(build) install DESTDIR=$(DESTDIR) $(to_log) - $(clean_up) - -fixup-sh4-newlib: newlib_inc=$(DESTDIR)$(sh_prefix)/$(sh_target)/include -fixup-sh4-newlib: $(build_newlib) - @echo "+++ Fixing up sh4 newlib includes..." -# KOS pthread.h is modified -# to define _POSIX_THREADS -# pthreads to kthreads mapping -# so KOS includes are available as kos/file.h -# kos/thread.h requires arch/arch.h -# arch/arch.h requires dc/video.h - cp $(kos_base)/include/pthread.h $(newlib_inc) - cp $(kos_base)/include/sys/_pthread.h $(newlib_inc)/sys - cp $(kos_base)/include/sys/sched.h $(newlib_inc)/sys - ln -nsf $(kos_base)/include/kos $(newlib_inc) - ln -nsf $(kos_base)/kernel/arch/dreamcast/include/arch $(newlib_inc) - ln -nsf $(kos_base)/kernel/arch/dreamcast/include/dc $(newlib_inc) - -$(build_gcc_pass2): log = $(logdir)/$(build)-pass2.log -$(build_gcc_pass2): logdir - @echo "+++ Building $(src_dir) to $(build) (pass 2)..." - -mkdir -p $(build) - > $(log) - cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) --with-newlib --disable-libssp --disable-tls \ - --enable-threads=$(thread_model) --enable-languages=$(pass2_languages) $(extra_configure_args) CXX=$(CXX) $(to_log) - $(MAKE) $(makejobs) -C $(build) DESTDIR=$(DESTDIR) $(to_log) - $(MAKE) -C $(build) install-strip DESTDIR=$(DESTDIR) $(to_log) - $(clean_up) +include scripts/binutils.mk +include scripts/gcc-pass1.mk +include scripts/newlib.mk +include scripts/gcc-pass2.mk # ---- }}}} +# ---- optional components {{{ -# GDB building - -gdb-$(gdb_ver).tar.gz: - @echo "+++ Downloading GDB..." - wget -c ftp://ftp.gnu.org/gnu/gdb/gdb-$(gdb_ver).tar.gz - -unpack_gdb: gdb-$(gdb_ver).tar.gz unpack_gdb_stamp - -unpack_gdb_stamp: - @echo "+++ Unpacking GDB..." - rm -f $@ - rm -rf gdb-$(gdb_ver) - tar xf gdb-$(gdb_ver).tar.gz - touch $@ - -build_gdb: log = $(logdir)/gdb-$(gdb_ver).log -build_gdb: logdir -build_gdb: unpack_gdb build_gdb_stamp - -build_gdb_stamp: - @echo "+++ Building GDB..." - rm -f $@ - > $(log) - rm -rf build-gdb-$(gdb_ver) - mkdir build-gdb-$(gdb_ver) - cd build-gdb-$(gdb_ver); ../gdb-$(gdb_ver)/configure \ - --disable-werror \ - --prefix=$(sh_prefix) \ - --target=$(sh_target) $(to_log) - $(MAKE) $(makejobs) -C build-gdb-$(gdb_ver) $(to_log) - touch $@ - -install_gdb: log = $(logdir)/gdb-$(gdb_ver).log -install_gdb: logdir -install_gdb: build_gdb install_gdb_stamp - -install_gdb_stamp: - @echo "+++ Installing GDB..." - rm -f $@ - $(MAKE) -C build-gdb-$(gdb_ver) install DESTDIR=$(DESTDIR) $(to_log) - touch $@ - -gdb: install_gdb - - -# Insight building - -insight-$(insight_ver)a.tar.bz2: - @echo "+++ Downloading Insight..." - wget -c ftp://sourceware.org/pub/insight/releases/insight-$(insight_ver)a.tar.bz2 - -unpack_insight: insight-$(insight_ver)a.tar.bz2 unpack_insight_stamp - -unpack_insight_stamp: - @echo "+++ Unpacking Insight..." - rm -f $@ - rm -rf insight-$(insight_ver) - tar xf insight-$(insight_ver)a.tar.bz2 - touch $@ - -build_insight: log = $(logdir)/insight-$(insight_ver).log -build_insight: logdir -build_insight: unpack_insight build_insight_stamp - -build_insight_stamp: - @echo "+++ Building Insight..." - rm -f $@ - > $(log) - rm -rf build-insight-$(insight_ver) - mkdir build-insight-$(insight_ver) - cd build-insight-$(insight_ver); ../insight-$(insight_ver)/configure \ - --disable-werror \ - --prefix=$(sh_prefix) \ - --target=$(sh_target) $(to_log) - $(MAKE) $(makejobs) -C build-insight-$(insight_ver) $(to_log) - touch $@ - -install_insight: log = $(logdir)/insight-$(insight_ver).log -install_insight: logdir -install_insight: build_insight install_insight_stamp - -install_insight_stamp: ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-19 22:32:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via a9d0ae1cc06071469ba8a40480d2ca7f5e2b73e2 (commit) via 458c0161b41913af4532d15a94aa0536e761a750 (commit) via 78966b55870b7568fff818aa257d96568fd399ff (commit) via 19a855c0043b744d950f9b4eebebf74f0634e94a (commit) via 690759f7404842536783d63516132e1a19276306 (commit) via 36461a5be228fb8b5b2495bceb51dd839dfad5a7 (commit) via 5994dfaaeb7298eaab53dc2d8d7ce5378981fe18 (commit) via 0b90f21f4ac5e081cd87c70aab272f961d00292b (commit) from a123aa1dead51102c947f28ce05078168779008f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a9d0ae1cc06071469ba8a40480d2ca7f5e2b73e2 Merge: 458c016 5994dfa Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 18:31:53 2020 -0400 Merge pull request #47 from mrneo240/genromfs_mingw Basic genromfs support for Windows (without Cygwin or WSL). commit 458c0161b41913af4532d15a94aa0536e761a750 Merge: a123aa1 78966b5 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 18:28:54 2020 -0400 Merge pull request #48 from sizious/adventure-example-update Adventure example update commit 78966b55870b7568fff818aa257d96568fd399ff Merge: 19a855c a123aa1 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 18:28:33 2020 -0400 Merge branch 'master' into adventure-example-update commit 19a855c0043b744d950f9b4eebebf74f0634e94a Author: SiZiOUS <si...@gm...> Date: Thu Sep 17 22:29:04 2020 +0200 Updating .gitignore commit 690759f7404842536783d63516132e1a19276306 Author: SiZiOUS <si...@gm...> Date: Thu Sep 17 22:01:50 2020 +0200 Fixing detection of MinGW.org vs. MinGW-w64 environments commit 36461a5be228fb8b5b2495bceb51dd839dfad5a7 Author: SiZiOUS <si...@gm...> Date: Thu Sep 17 21:15:07 2020 +0200 Updating adventure example for MinGW compatibility commit 5994dfaaeb7298eaab53dc2d8d7ce5378981fe18 Author: HaydenKow <819...@us...> Date: Mon Sep 14 16:09:50 2020 -0400 chore: clean warnings and missing includes commit 0b90f21f4ac5e081cd87c70aab272f961d00292b Author: HaydenKow <819...@us...> Date: Sun Sep 13 18:23:26 2020 -0400 feat: support basic version of genromfs on windows - no support for symlinks - basic romfs images only ----------------------------------------------------------------------- Summary of changes: .gitignore | 5 ++-- examples/dreamcast/conio/adventure/Makefile | 45 +++++++++++++++++++++-------- examples/dreamcast/conio/adventure/hdr.h | 24 +++++++++++++++ examples/dreamcast/conio/adventure/setup.c | 13 ++++++--- utils/genromfs/Makefile | 7 ++++- utils/genromfs/genromfs.c | 41 +++++++++++++++++++------- 6 files changed, 105 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index b2b6a4a..b7e6fb3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,11 +26,13 @@ utils/gentexfont/gentexfont utils/isotest/isotest utils/makejitter/makejitter utils/dcbumpgen/dcbumpgen +utils/scramble/scramble +utils/makeip/makeip utils/naomibintool/naomibintool examples/dreamcast/basic/exec/romdisk/sub.bin examples/dreamcast/kgl/basic/vq/fruit.vq examples/dreamcast/conio/adventure/data.c -examples/dreamcast/conio/adventure/setup +examples/dreamcast/conio/adventure/datagen examples/dreamcast/png/romdisk_boot.img examples/dreamcast/pvr/modifier_volume_tex/romdisk/fruit.kmg examples/dreamcast/pvr/texture_render/texture_render.bin @@ -42,4 +44,3 @@ utils/dc-chain/gcc-* utils/dc-chain/newlib-* utils/dc-chain/gdb-* utils/dc-chain/insight-* -utils/scramble/scramble diff --git a/examples/dreamcast/conio/adventure/Makefile b/examples/dreamcast/conio/adventure/Makefile index eae1490..f192fc8 100644 --- a/examples/dreamcast/conio/adventure/Makefile +++ b/examples/dreamcast/conio/adventure/Makefile @@ -4,28 +4,49 @@ # (c)2002 Dan Potter # -all: rm-elf adventure.elf +# Program binary +TARGET = adventure.elf + +# Script data files +DATA_SOURCE = glorkz +DATA_TARGET = data.c + +# For MinGW/MSYS, MinGW-w64/MSYS2 and Cygwin +ifeq ($(shell echo $(OS)),Windows_NT) + EXECUTABLEEXTENSION := .exe +endif + +# Setup data utility processing +# Under Windows, avoid the "setup.exe" name as it causes problems with the UAC... +SETUP_SOURCE = setup.c +SETUP_TARGET = datagen$(EXECUTABLEEXTENSION) +SETUP_CFLAGS = -DSETUP + +# Additional configuration +HOST_CC = gcc + +all: rm-elf $(TARGET) include $(KOS_BASE)/Makefile.rules OBJS = porthelper.o crc.o done.o init.o io.o main.o save.o subr.o vocab.o wizard.o data.o -data.c: - gcc -o setup setup.c -DSETUP - ./setup glorkz > data.c +$(DATA_TARGET): + $(HOST_CC) -o $(SETUP_TARGET) $(SETUP_SOURCE) $(SETUP_CFLAGS) + ./$(SETUP_TARGET) $(DATA_SOURCE) > $(DATA_TARGET) clean: - -rm -f adventure.elf $(OBJS) data.c setup + -rm -f $(TARGET) $(OBJS) $(DATA_TARGET) $(SETUP_TARGET) rm-elf: - -rm -f adventure.elf + -rm -f $(TARGET) -adventure.elf: $(OBJS) - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o adventure.elf $(KOS_START) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -lconio $(KOS_LIBS) +$(TARGET): $(OBJS) + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -lconio $(KOS_LIBS) -run: adventure.elf - $(KOS_LOADER) adventure.elf +run: $(TARGET) + $(KOS_LOADER) $(TARGET) dist: - -rm -f $(OBJS) data.c setup - $(KOS_STRIP) adventure.elf + -rm -f $(OBJS) $(DATA_TARGET) $(SETUP_TARGET) + $(KOS_STRIP) $(TARGET) diff --git a/examples/dreamcast/conio/adventure/hdr.h b/examples/dreamcast/conio/adventure/hdr.h index faadfd4..dc9839d 100644 --- a/examples/dreamcast/conio/adventure/hdr.h +++ b/examples/dreamcast/conio/adventure/hdr.h @@ -55,6 +55,30 @@ /* hdr.h: included by c advent files */ #ifdef SETUP + +/* Detect MinGW/MSYS vs. MinGW-w64/MSYS2 */ +#ifdef __MINGW32__ +#include <_mingw.h> +# ifdef __MINGW64_VERSION_MAJOR +# define __RT_MINGW_W64__ +# else +# define __RT_MINGW_ORG__ +# endif +#endif /* __MINGW32__ */ + +#ifdef __MINGW32__ +#ifdef __RT_MINGW_W64__ +/* MinGW-w64/MSYS2 */ +typedef unsigned long u_long; +#else +/* MinGW/MSYS */ +#define _BSD_SOURCE +#include <sys/bsdtypes.h> +#endif +#include <stdlib.h> +#define srandom srand +#endif /* __MINGW32__ */ + #include <sys/types.h> #include <signal.h> #else diff --git a/examples/dreamcast/conio/adventure/setup.c b/examples/dreamcast/conio/adventure/setup.c index cc56b75..5995845 100644 --- a/examples/dreamcast/conio/adventure/setup.c +++ b/examples/dreamcast/conio/adventure/setup.c @@ -66,7 +66,7 @@ static const char rcsid[] = /* #include <err.h> */ #include "hdr.h" /* SEED lives in there; keep them coordinated. */ -#define USAGE "Usage: setup file > data.c (file is typically glorkz)" +#define USAGE "Usage: setup file > data.c (file is typically glorkz)\n" #define YES 1 #define NO 0 @@ -78,10 +78,15 @@ main(int argc, char **argv) { FILE *infile; int c, count, linestart; - if(argc != 2) printf(USAGE); + if(argc != 2) { + printf(USAGE); + exit(2); + } - if((infile = fopen(argv[1], "r")) == NULL) - printf("Can't read file %s", argv[1]); + if((infile = fopen(argv[1], "r")) == NULL) { + printf("Can't read file %s\n", argv[1]); + exit(1); + } puts("/*\n * data.c: created by setup from the ascii data file."); puts(SIG1); diff --git a/utils/genromfs/Makefile b/utils/genromfs/Makefile index fd0725c..402901c 100644 --- a/utils/genromfs/Makefile +++ b/utils/genromfs/Makefile @@ -1,8 +1,13 @@ # Makefile for the genromfs program. +ifeq ($(OS), Windows_NT) + LDLIBS = -lshlwapi -lws2_32 +else +# Nothing +endif CFLAGS = -O2 -Wall #-g# -#LDFLAGS = -s -g +LDFLAGS = -s all: genromfs diff --git a/utils/genromfs/genromfs.c b/utils/genromfs/genromfs.c index 7f98906..a52b2e4 100644 --- a/utils/genromfs/genromfs.c +++ b/utils/genromfs/genromfs.c @@ -18,6 +18,8 @@ * 11 Jan 2001 special files of name @name,[cpub],major,minor * 21 Feb 2001 Cygwin build fixes * (Florian Schulze, Brian Peek) + * 13 Aug 2020 Mingw build fixes + * (Hayden Kowalchuk) */ /* @@ -67,26 +69,25 @@ #include <stdio.h> /* Userland pieces of the ANSI C standard I/O package */ #include <stdlib.h> /* Userland prototypes of the ANSI C std lib functions */ +#include <stdint.h> #include <string.h> /* Userland prototypes of the string handling funcs */ #include <unistd.h> /* Userland prototypes of the Unix std system calls */ #include <fcntl.h> /* Flag value for file handling functions */ #include <time.h> #if defined(_WIN32) && !defined(__CYGWIN__) # include <getopt.h> +# include <winsock2.h> +# include <shlwapi.h> +# define lstat stat #else +# include <sys/sysmacros.h> +# include <netinet/in.h> /* Consts & structs defined by the internet system */ # include <fnmatch.h> #endif /* _WIN32 */ #include <dirent.h> #include <sys/stat.h> #include <sys/types.h> - -#include <netinet/in.h> /* Consts & structs defined by the internet system */ - -/* good old times without autoconf... */ -#if defined(linux) || defined(sun) -#include <sys/sysmacros.h> -#endif - +#include <inttypes.h> struct romfh { int32_t nextfh; @@ -206,7 +207,11 @@ int nodematch(char *pattern, struct filenode *node) { /* XXX: ugly realbase is global */ if(pattern[0] == '/') start = node->realname + realbase; +#if defined(_WIN32) && !defined(__CYGWIN__) + return !PathMatchSpec(start, pattern); +#else return fnmatch(pattern, start, FNM_PATHNAME | FNM_PERIOD); +#endif } int findalign(struct filenode *node) { @@ -314,8 +319,8 @@ void dumpri(struct romfh *ri, struct filenode *n, FILE *f) { #if 0 fprintf(stderr, "RI: [at %06x] %08lx, %08lx, %08lx, %08lx [%s]\n", n->offset, - ntohl(ri->nextfh), ntohl(ri->spec), - ntohl(ri->size), ntohl(ri->checksum), + (long unsigned int)ntohl(ri->nextfh), (long unsigned int)ntohl(ri->spec), + (long unsigned int)ntohl(ri->size), (long unsigned int)ntohl(ri->checksum), n->name); #endif } @@ -358,6 +363,7 @@ int dumpnode(struct filenode *node, FILE *f) { dumpri(&ri, node, f); } +#if !defined(_WIN32) || defined(__CYGWIN__) else if(S_ISLNK(node->modes)) { ri.nextfh |= htonl(ROMFH_LNK); dumpri(&ri, node, f); @@ -367,6 +373,7 @@ int dumpnode(struct filenode *node, FILE *f) { } dumpdataa(bigbuf, node->size, f); } +#endif else if(S_ISREG(node->modes)) { int offset, len, fd, max, avail; ri.nextfh |= htonl(ROMFH_REG); @@ -404,6 +411,7 @@ int dumpnode(struct filenode *node, FILE *f) { offset += avail; } } +#if !defined(_WIN32) || defined(__CYGWIN__) else if(S_ISCHR(node->modes)) { ri.nextfh |= htonl(ROMFH_CHR); ri.spec = htonl(major(node->devnode) << 16 | minor(node->devnode)); @@ -422,6 +430,7 @@ int dumpnode(struct filenode *node, FILE *f) { ri.nextfh |= htonl(ROMFH_SCK); dumpri(&ri, node, f); } +#endif p = node->dirlist.head; @@ -547,7 +556,11 @@ struct filenode *findnode(struct filenode *node, dev_t dev, ino_t ino) { found = findnode(p, dev, ino); if(found) +#if defined(_WIN32) && !defined(__CYGWIN__) + return NULL; +#else return found; +#endif p = p->next; } @@ -638,6 +651,7 @@ int processdir(int level, const char *base, const char *dirname, struct stat *sb continue; } +#if !defined(_WIN32) || defined(__CYGWIN__) /* Handle special names */ if(n->name[0] == '@') { if(S_ISLNK(sb->st_mode)) { @@ -691,15 +705,18 @@ int processdir(int level, const char *base, const char *dirname, struct stat *sb } } } +#endif setnode(n, sb->st_dev, sb->st_ino, sb->st_mode); +#if !defined(_WIN32) || defined(__CYGWIN__) /* Skip unreadable files/dirs */ if(!S_ISLNK(n->modes) && access(n->realname, R_OK)) { fprintf(stderr, "ignoring '%s' (access failed)\n", n->realname); freenode(n); continue; } +#endif /* Look up old links */ if(strcmp(n->name, ".") == 0) { @@ -728,9 +745,11 @@ int processdir(int level, const char *base, const char *dirname, struct stat *sb else curroffset = alignnode(n, curroffset, 0); +#if !defined(_WIN32) || defined(__CYGWIN__) if(S_ISLNK(sb->st_mode)) { n->size = sb->st_size; } +#endif curroffset += spaceneeded(n); @@ -866,7 +885,7 @@ int main(int argc, char *argv[]) { } if(!volname) { - sprintf(buf, "rom %08lx", time(NULL)); + sprintf(buf, "rom %" PRId64, (int64_t)time(NULL)); volname = buf; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-19 22:24:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via a123aa1dead51102c947f28ce05078168779008f (commit) from 1da0dd4fa5fb3503adefcb7e20f4d0ebe050108e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a123aa1dead51102c947f28ce05078168779008f Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 19 18:24:23 2020 -0400 Bring the AICA communication structs out to a public header. ----------------------------------------------------------------------- Summary of changes: .../dc/sound/aica_comm.h} | 41 ++-------- kernel/arch/dreamcast/sound/Makefile | 2 +- kernel/arch/dreamcast/sound/arm/Makefile | 4 +- kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h | 95 +--------------------- 4 files changed, 9 insertions(+), 133 deletions(-) copy kernel/arch/dreamcast/{sound/arm/aica_cmd_iface.h => include/dc/sound/aica_comm.h} (76%) diff --git a/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h b/kernel/arch/dreamcast/include/dc/sound/aica_comm.h similarity index 76% copy from kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h copy to kernel/arch/dreamcast/include/dc/sound/aica_comm.h index aba0a51..ba6d9af 100644 --- a/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h +++ b/kernel/arch/dreamcast/include/dc/sound/aica_comm.h @@ -1,14 +1,14 @@ /* KallistiOS ##version## - aica_cmd_iface.h - (c)2000-2002 Dan Potter + aica_comm.h + Copyright (C) 2000-2002 Dan Potter - Definitions for the SH-4/AICA interface. This file is meant to be + Structure and constant definitions for the SH-4/AICA interface. This file is included from both the ARM and SH-4 sides of the fence. */ -#ifndef __ARM_AICA_CMD_IFACE_H -#define __ARM_AICA_CMD_IFACE_H +#ifndef __DC_SOUND_AICA_COMM_H +#define __DC_SOUND_AICA_COMM_H #ifndef __ARCH_TYPES_H typedef unsigned long uint8; @@ -104,33 +104,4 @@ typedef struct aica_channel { #define AICA_SM_16BIT 0 #define AICA_SM_ADPCM 2 - -/* This is where our SH-4/AICA comm variables go... */ - -/* 0x000000 - 0x010000 are reserved for the program */ - -/* Location of the SH-4 to AICA queue; commands from here will be - periodically processed by the AICA and then removed from the queue. */ -#define AICA_MEM_CMD_QUEUE 0x010000 /* 32K */ - -/* Location of the AICA to SH-4 queue; commands from here will be - periodically processed by the SH-4 and then removed from the queue. */ -#define AICA_MEM_RESP_QUEUE 0x018000 /* 32K */ - -/* This is the channel base, which holds status structs for all the - channels. This is READ-ONLY from the SH-4 side. */ -#define AICA_MEM_CHANNELS 0x020000 /* 64 * 16*4 = 4K */ - -/* The clock value (in milliseconds) */ -#define AICA_MEM_CLOCK 0x021000 /* 4 bytes */ - -/* 0x021004 - 0x030000 are reserved for future expansion */ - -/* Open ram for sample data */ -#define AICA_RAM_START 0x030000 -#define AICA_RAM_END 0x200000 - -/* Quick access to the AICA channels */ -#define AICA_CHANNEL(x) (AICA_MEM_CHANNELS + (x) * sizeof(aica_channel_t)) - -#endif /* __ARM_AICA_CMD_IFACE_H */ +#endif /* !__DC_SOUND_AICA_COMM_H */ diff --git a/kernel/arch/dreamcast/sound/Makefile b/kernel/arch/dreamcast/sound/Makefile index 72ab8cc..352021d 100644 --- a/kernel/arch/dreamcast/sound/Makefile +++ b/kernel/arch/dreamcast/sound/Makefile @@ -5,6 +5,7 @@ # OBJS = snd_iface.o snd_sfxmgr.o snd_stream.o snd_stream_drv.o snd_mem.o +KOS_CFLAGS += -I $(KOS_BASE)/kernel/arch/dreamcast/include/dc/sound # Only compile this if we have an ARM compiler handy ifdef DC_ARM_CC @@ -15,4 +16,3 @@ include $(KOS_BASE)/Makefile.prefab snd_stream_drv.o: subdirs arm/stream.drv $(KOS_BASE)/utils/bin2o/bin2o arm/stream.drv snd_stream_drv snd_stream_drv.o - diff --git a/kernel/arch/dreamcast/sound/arm/Makefile b/kernel/arch/dreamcast/sound/arm/Makefile index eab400e..18466bc 100644 --- a/kernel/arch/dreamcast/sound/arm/Makefile +++ b/kernel/arch/dreamcast/sound/arm/Makefile @@ -14,12 +14,10 @@ prog.elf: crt0.o main.o aica.o $(DC_ARM_CC) -Wl,-Ttext,0x00000000,-Map,prog.map,-N -nostartfiles -nostdlib -e reset -o prog.elf crt0.o main.o aica.o -lgcc %.o: %.c - $(DC_ARM_CC) $(DC_ARM_CFLAGS) $(DC_ARM_INCS) -c $< -o $@ + $(DC_ARM_CC) $(DC_ARM_CFLAGS) $(DC_ARM_INCS) -I $(KOS_BASE)/kernel/arch/dreamcast/include/dc/sound -c $< -o $@ %.o: %.s $(DC_ARM_AS) $(DC_ARM_AFLAGS) $< -o $@ clean: -rm -f *.o *.srec *.elf 1ST_READ.BIN prog.bin *.bck prog.map - - diff --git a/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h b/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h index aba0a51..0c88580 100644 --- a/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h +++ b/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h @@ -10,100 +10,7 @@ #ifndef __ARM_AICA_CMD_IFACE_H #define __ARM_AICA_CMD_IFACE_H -#ifndef __ARCH_TYPES_H -typedef unsigned long uint8; -typedef unsigned long uint32; -#endif - -/* Command queue; one of these for passing data from the SH-4 to the - AICA, and another for the other direction. If a command is written - to the queue and it is longer than the amount of space between the - head point and the queue size, the command will wrap around to - the beginning (i.e., queue commands _can_ be split up). */ -typedef struct aica_queue { - uint32 head; /* Insertion point offset (in bytes) */ - uint32 tail; /* Removal point offset (in bytes) */ - uint32 size; /* Queue size (in bytes) */ - uint32 valid; /* 1 if the queue structs are valid */ - uint32 process_ok; /* 1 if it's ok to process the data */ - uint32 data; /* Pointer to queue data buffer */ -} aica_queue_t; - -/* Command queue struct for commanding the AICA from the SH-4 */ -typedef struct aica_cmd { - uint32 size; /* Command data size in dwords */ - uint32 cmd; /* Command ID */ - uint32 timestamp; /* When to execute the command (0 == now) */ - uint32 cmd_id; /* Command ID, for cmd/response pairs, or channel id */ - uint32 misc[4]; /* Misc Parameters / Padding */ - uint8 cmd_data[]; /* Command data */ -} aica_cmd_t; - -/* Maximum command size -- 256 dwords */ -#define AICA_CMD_MAX_SIZE 256 - -/* This is the cmd_data for AICA_CMD_CHAN. Make this 16 dwords long - for two aica bus queues. */ -typedef struct aica_channel { - uint32 cmd; /* Command ID */ - uint32 base; /* Sample base in RAM */ - uint32 type; /* (8/16bit/ADPCM) */ - uint32 length; /* Sample length */ - uint32 loop; /* Sample looping */ - uint32 loopstart; /* Sample loop start */ - uint32 loopend; /* Sample loop end */ - uint32 freq; /* Frequency */ - uint32 vol; /* Volume 0-255 */ - uint32 pan; /* Pan 0-255 */ - uint32 pos; /* Sample playback pos */ - uint32 pad[5]; /* Padding */ -} aica_channel_t; - -/* Declare an aica_cmd_t big enough to hold an aica_channel_t - using temp name T, aica_cmd_t name CMDR, and aica_channel_t name CHANR */ -#define AICA_CMDSTR_CHANNEL(T, CMDR, CHANR) \ - uint8 T[sizeof(aica_cmd_t) + sizeof(aica_channel_t)]; \ - aica_cmd_t * CMDR = (aica_cmd_t *)T; \ - aica_channel_t * CHANR = (aica_channel_t *)(CMDR->cmd_data); -#define AICA_CMDSTR_CHANNEL_SIZE ((sizeof(aica_cmd_t) + sizeof(aica_channel_t))/4) - -/* Command values (for aica_cmd_t) */ -#define AICA_CMD_NONE 0x00000000 /* No command (dummy packet) */ -#define AICA_CMD_PING 0x00000001 /* Check for signs of life */ -#define AICA_CMD_CHAN 0x00000002 /* Perform a wavetable action */ -#define AICA_CMD_SYNC_CLOCK 0x00000003 /* Reset the millisecond clock */ - -/* Response values (for aica_cmd_t) */ -#define AICA_RESP_NONE 0x00000000 -#define AICA_RESP_PONG 0x00000001 /* Response to CMD_PING */ -#define AICA_RESP_DBGPRINT 0x00000002 /* Entire payload is a null-terminated string */ - -/* Command values (for aica_channel_t commands) */ -#define AICA_CH_CMD_MASK 0x0000000f - -#define AICA_CH_CMD_NONE 0x00000000 -#define AICA_CH_CMD_START 0x00000001 -#define AICA_CH_CMD_STOP 0x00000002 -#define AICA_CH_CMD_UPDATE 0x00000003 - -/* Start values */ -#define AICA_CH_START_MASK 0x00300000 - -#define AICA_CH_START_DELAY 0x00100000 /* Set params, but delay key-on */ -#define AICA_CH_START_SYNC 0x00200000 /* Set key-on for all selected channels */ - -/* Update values */ -#define AICA_CH_UPDATE_MASK 0x000ff000 - -#define AICA_CH_UPDATE_SET_FREQ 0x00001000 /* frequency */ -#define AICA_CH_UPDATE_SET_VOL 0x00002000 /* volume */ -#define AICA_CH_UPDATE_SET_PAN 0x00004000 /* panning */ - -/* Sample types */ -#define AICA_SM_8BIT 1 -#define AICA_SM_16BIT 0 -#define AICA_SM_ADPCM 2 - +#include "aica_comm.h" /* This is where our SH-4/AICA comm variables go... */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-17 01:10:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of OpenGL.". The branch, master has been updated via c4938f4b976cb7a1defd0ede491ab4f68355fbd3 (commit) from dadcadc2d7c905bec148500460bcfedf1cca84f0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c4938f4b976cb7a1defd0ede491ab4f68355fbd3 Author: Lawrence Sebald <ljs...@us...> Date: Wed Sep 16 21:10:42 2020 -0400 Fix stupid typo. ----------------------------------------------------------------------- Summary of changes: gl-pvr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gl-pvr.c b/gl-pvr.c index d31877e..2898b34 100644 --- a/gl-pvr.c +++ b/gl-pvr.c @@ -191,7 +191,7 @@ inline void _glKosVertexBufReset() { GL_VERTS[0] = GL_VERTS[1] = 0; } -staic inline GLuint _glKosVertexBufCount(GLubyte list) { +static inline GLuint _glKosVertexBufCount(GLubyte list) { return GL_VERTS[list]; } hooks/post-receive -- The KallistiOS port of OpenGL. |
From: Lawrence S. <ljs...@us...> - 2020-09-17 01:09:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of OpenGL.". The branch, master has been updated via dadcadc2d7c905bec148500460bcfedf1cca84f0 (commit) from 6d55e4c7460e0236ab5d1cc983e62411b75b1390 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit dadcadc2d7c905bec148500460bcfedf1cca84f0 Author: Lawrence Sebald <ljs...@us...> Date: Wed Sep 16 21:09:42 2020 -0400 More inline fixes. ----------------------------------------------------------------------- Summary of changes: gl-api.h | 1 - gl-pvr.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gl-api.h b/gl-api.h index 7ba95e3..f2eca8f 100644 --- a/gl-api.h +++ b/gl-api.h @@ -66,7 +66,6 @@ void _glKosVertexBufAdd(unsigned int count); void _glKosTRVertexBufAdd(unsigned int count); void _glKosVertexBufDecrement(); void _glKosVertexBufReset(); -inline unsigned int _glKosVertexBufCount(unsigned char list); unsigned char _glKosList(); void _glKosVertexBufCopy(void *src, void *dst, GLuint count); void _glKosResetEnabledTex(); diff --git a/gl-pvr.c b/gl-pvr.c index 5995989..d31877e 100644 --- a/gl-pvr.c +++ b/gl-pvr.c @@ -103,7 +103,7 @@ inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex, GL_MTOBJS[GL_MTOBJECTS++].count = count; } -inline void _glKosResetMultiTexObject() { +static inline void _glKosResetMultiTexObject() { GL_MTOBJECTS = 0; } @@ -139,7 +139,7 @@ inline void _glKosClipBufIncrement() { ++GL_CVERTS; } -inline void _glKosClipBufAdd(GLuint count) { +void _glKosClipBufAdd(GLuint count) { GL_CVERTS += count; } @@ -191,7 +191,7 @@ inline void _glKosVertexBufReset() { GL_VERTS[0] = GL_VERTS[1] = 0; } -inline GLuint _glKosVertexBufCount(GLubyte list) { +staic inline GLuint _glKosVertexBufCount(GLubyte list) { return GL_VERTS[list]; } hooks/post-receive -- The KallistiOS port of OpenGL. |
From: Lawrence S. <ljs...@us...> - 2020-09-17 01:03:22
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of OpenGL.". The branch, master has been updated via 6d55e4c7460e0236ab5d1cc983e62411b75b1390 (commit) from a1185f3369895df4b29cd476e4a53e70b53d7a4e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6d55e4c7460e0236ab5d1cc983e62411b75b1390 Author: Lawrence Sebald <ljs...@us...> Date: Wed Sep 16 21:03:01 2020 -0400 Remove inline attribute from functions that aren't inlineable. ----------------------------------------------------------------------- Summary of changes: gl-api.h | 58 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/gl-api.h b/gl-api.h index fa3c15f..7ba95e3 100644 --- a/gl-api.h +++ b/gl-api.h @@ -55,38 +55,38 @@ typedef GLushort uint16; typedef GLubyte uint8; /* Vertex Main Buffer Internal Functions */ -inline void _glKosVertexBufSwitchOP(); -inline void _glKosVertexBufSwitchTR(); -inline void *_glKosVertexBufAddress(unsigned char list); -inline void *_glKosVertexBufPointer(); -inline void *_glKosTRVertexBufPointer(); -inline void _glKosVertexBufIncrement(); -inline void _glKosTRVertexBufIncrement(); -inline void _glKosVertexBufAdd(unsigned int count); -inline void _glKosTRVertexBufAdd(unsigned int count); -inline void _glKosVertexBufDecrement(); -inline void _glKosVertexBufReset(); +void _glKosVertexBufSwitchOP(); +void _glKosVertexBufSwitchTR(); +void *_glKosVertexBufAddress(unsigned char list); +void *_glKosVertexBufPointer(); +void *_glKosTRVertexBufPointer(); +void _glKosVertexBufIncrement(); +void _glKosTRVertexBufIncrement(); +void _glKosVertexBufAdd(unsigned int count); +void _glKosTRVertexBufAdd(unsigned int count); +void _glKosVertexBufDecrement(); +void _glKosVertexBufReset(); inline unsigned int _glKosVertexBufCount(unsigned char list); unsigned char _glKosList(); -inline void _glKosVertexBufCopy(void *src, void *dst, GLuint count); -inline void _glKosResetEnabledTex(); -inline void *_glKosMultiUVBufAddress(); -inline void *_glKosMultiUVBufPointer(); -inline void _glKosMultiUVBufIncrement(); -inline void _glKosMultiUVBufAdd(GLuint count); -inline void _glKosMultiUVBufReset(); +void _glKosVertexBufCopy(void *src, void *dst, GLuint count); +void _glKosResetEnabledTex(); +void *_glKosMultiUVBufAddress(); +void *_glKosMultiUVBufPointer(); +void _glKosMultiUVBufIncrement(); +void _glKosMultiUVBufAdd(GLuint count); +void _glKosMultiUVBufReset(); /* Vertex Clip Buffer Internal Functions */ -inline void *_glKosClipBufAddress(); -inline void *_glKosClipBufPointer(); -inline void _glKosClipBufIncrement(); -inline void _glKosClipBufReset(); +void *_glKosClipBufAddress(); +void *_glKosClipBufPointer(); +void _glKosClipBufIncrement(); +void _glKosClipBufReset(); /* Vertex Array Buffer Internal Functions */ -inline void _glKosArrayBufIncrement(); -inline void _glKosArrayBufReset(); -inline glVertex *_glKosArrayBufAddr(); -inline glVertex *_glKosArrayBufPtr(); +void _glKosArrayBufIncrement(); +void _glKosArrayBufReset(); +glVertex *_glKosArrayBufAddr(); +glVertex *_glKosArrayBufPtr(); /* Initialize the OpenGL PVR Pipeline */ int _glKosInitPVR(); @@ -211,9 +211,9 @@ GLubyte _glKosEnabledTextureMatrix(); GL_TEXTURE_OBJECT *_glKosBoundMultiTexID(); -inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex, - pvr_vertex_t *src, - GLuint count); +void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex, + pvr_vertex_t *src, + GLuint count); static inline void _glKosVertexCopyPVR(const pvr_vertex_t *src, pvr_vertex_t *dst) { *dst = *src; hooks/post-receive -- The KallistiOS port of OpenGL. |
From: Lawrence S. <ljs...@us...> - 2020-09-11 03:04:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 1da0dd4fa5fb3503adefcb7e20f4d0ebe050108e (commit) via 5f48f6ab690a4663247784c84fc5c80962f73fc0 (commit) from 500cab7a308b483bcfcf8b1d05d307583d440308 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1da0dd4fa5fb3503adefcb7e20f4d0ebe050108e Author: Lawrence Sebald <ljs...@us...> Date: Thu Sep 10 23:03:52 2020 -0400 Add naominetboot tool. commit 5f48f6ab690a4663247784c84fc5c80962f73fc0 Author: Lawrence Sebald <ljs...@us...> Date: Wed Sep 9 20:38:10 2020 -0400 Make getopt() return ':' on an option being passed without its argument. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 4 + utils/Makefile | 3 +- utils/naomibintool/naomibintool.c | 2 +- utils/naominetboot/Makefile | 13 ++ utils/naominetboot/naominetboot.c | 358 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 378 insertions(+), 2 deletions(-) create mode 100644 utils/naominetboot/Makefile create mode 100644 utils/naominetboot/naominetboot.c diff --git a/doc/CHANGELOG b/doc/CHANGELOG index dd9a64d..e2a5483 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -129,6 +129,10 @@ KallistiOS version 2.1.0 ----------------------------------------------- type for ino_t to be sensible in Newlib 3.3.0 patch [TS, LS] - *** Fixed argument check in sem_init. Thanks to TapamN at DCEmulation for noticing the issue and proposing the fix [LS] +- NAO Updated the NAOMI header parsing tool to also support creating NAOMI + binaries and renamed it to naomibintool [LS] +- NAO Added naominetboot - a tool to upload NAOMI formatted binaries to a + NetDIMM board for executing on the NAOMI [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/utils/Makefile b/utils/Makefile index 3b6707d..d5012a9 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -4,7 +4,8 @@ # (c)2001 Dan Potter # -DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip naomibintool +DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip naomibintool \ + naominetboot # Ok for these to fail atm... diff --git a/utils/naomibintool/naomibintool.c b/utils/naomibintool/naomibintool.c index 4feee5e..000fd96 100644 --- a/utils/naomibintool/naomibintool.c +++ b/utils/naomibintool/naomibintool.c @@ -480,7 +480,7 @@ int build_rom(int argc, char *argv[]) { } /* Parse arguments. */ - while((i = getopt(argc - 2, argv2, "p:d:t:b:s:e:")) != -1) { + while((i = getopt(argc - 2, argv2, ":p:d:t:b:s:e:")) != -1) { switch(i) { case 'p': j = strlen(optarg); diff --git a/utils/naominetboot/Makefile b/utils/naominetboot/Makefile new file mode 100644 index 0000000..e3ee9e8 --- /dev/null +++ b/utils/naominetboot/Makefile @@ -0,0 +1,13 @@ +# KallistiOS ##version## +# +# utils/naominetboot/Makefile +# Copyright (C) 2020 Lawrence Sebald +# + +all: naominetboot + +naominetboot: naominetboot.c + $(CC) -o naominetboot naominetboot.c + +clean: + -rm -f naominetboot diff --git a/utils/naominetboot/naominetboot.c b/utils/naominetboot/naominetboot.c new file mode 100644 index 0000000..983e64b --- /dev/null +++ b/utils/naominetboot/naominetboot.c @@ -0,0 +1,358 @@ +/* KallistiOS ##version## + + naomibintool.c + Copyright (C) 2020 Lawrence Sebald + +*/ + +/* Functionality adapted from the Triforce Netfirm Toolbox, which was put into + the public domain by debugmode. + + This program only implements the bare minimum functionality to upload a + program to a NAOMI NetDIMM and doesn't try to do any more than that. */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <stdint.h> + +#include <sys/socket.h> +#include <sys/signal.h> +#include <arpa/inet.h> +#include <netinet/in.h> + +#define NETDIMM_PORT 10703 + +/* This function is taken (with minor modifications) from: + KallistiOS ##version## + + kernel/net/net_crc.c + Copyright (C) 2009, 2010, 2012 Lawrence Sebald + +*/ +uint32_t crc32le(uint32_t crc, const uint8_t *data, int size) { + int i; + uint32_t rv = ~crc; + + for(i = 0; i < size; ++i) { + rv ^= data[i]; + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + rv = (0xEDB88320 & (-(rv & 1))) ^ (rv >> 1); + } + + return ~rv; +} + +ssize_t send_restart_cmd(int s) { + uint8_t cmd[4] = { 0x00, 0x00, 0x00, 0x0A }; + return send(s, cmd, 4, 0); +} + +ssize_t send_prog_info(int s, uint32_t crc, uint32_t len) { + uint8_t cmd[16] = { 0x0C, 0x00, 0x00, 0x19 }; + + cmd[4] = (uint8_t)(crc & 0xFF); + cmd[5] = (uint8_t)((crc >> 8) & 0xFF); + cmd[6] = (uint8_t)((crc >> 16) & 0xFF); + cmd[7] = (uint8_t)((crc >> 24) & 0xFF); + cmd[8] = (uint8_t)(len & 0xFF); + cmd[9] = (uint8_t)((len >> 8) & 0xFF); + cmd[10] = (uint8_t)((len >> 16) & 0xFF); + cmd[11] = (uint8_t)((len >> 24) & 0xFF); + cmd[12] = cmd[13] = cmd[14] = cmd[15] = 0; + + return send(s, cmd, 16, 0); +} + +ssize_t set_key(int s, const uint8_t key[8]) { + uint8_t cmd[12] = { 0x08, 0x00, 0x00, 0x7F }; + + memcpy(&cmd[4], key, 8); + return send(s, cmd, 12, 0); +} + +ssize_t set_null_key(int s) { + uint8_t key[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + return set_key(s, key); +} + +ssize_t upload_data(int s, uint32_t addr, uint32_t len, const uint8_t data[]) { + uint8_t cmd[14]; + + len += 0x0A; + cmd[0] = (uint8_t)(len & 0xFF); + cmd[1] = (uint8_t)((len >> 8) & 0xFF); + cmd[2] = 0x80; + cmd[3] = 0x04; + cmd[4] = cmd[5] = cmd[6] = cmd[7] = 0; + cmd[8] = (uint8_t)(addr & 0xFF); + cmd[9] = (uint8_t)((addr >> 8) & 0xFF); + cmd[10] = (uint8_t)((addr >> 16) & 0xFF); + cmd[11] = (uint8_t)((addr >> 24) & 0xFF); + cmd[12] = cmd[13] = 0; + + if(send(s, cmd, 14, 0) < 14) { + perror("Upload Failed"); + } + + return send(s, data, len - 0x0A, 0); +} + +ssize_t finalize_upload(int s, uint32_t addr) { + uint8_t cmd[22]; + + cmd[0] = 0x12; + cmd[1] = 0; + cmd[2] = 0x81; + cmd[3] = 0x04; + cmd[4] = cmd[5] = cmd[6] = cmd[7] = 0; + cmd[8] = (uint8_t)(addr & 0xFF); + cmd[9] = (uint8_t)((addr >> 8) & 0xFF); + cmd[10] = (uint8_t)((addr >> 16) & 0xFF); + cmd[11] = (uint8_t)((addr >> 24) & 0xFF); + cmd[12] = cmd[13] = 0; + cmd[14] = '1'; + cmd[15] = '2'; + cmd[16] = '3'; + cmd[17] = '4'; + cmd[18] = '5'; + cmd[19] = '6'; + cmd[20] = '7'; + cmd[21] = '8'; + + return send(s, cmd, 22, 0); +} + +ssize_t set_time_limit(int s, uint32_t limit) { + uint8_t cmd[8] = { 0x04, 0x00, 0x00, 0x17 }; + + cmd[4] = (uint8_t)(limit & 0xFF); + cmd[5] = (uint8_t)((limit >> 8) & 0xFF); + cmd[6] = (uint8_t)((limit >> 16) & 0xFF); + cmd[7] = (uint8_t)((limit >> 24) & 0xFF); + + return send(s, cmd, 8, 0); +} + +ssize_t set_host_mode(int s, uint8_t v_and, uint8_t v_or) { + uint8_t cmd[8] = { 0x04, 0x00, 0x00, 0x07 }; + + cmd[4] = (uint8_t)(v_or); + cmd[5] = (uint8_t)(v_and); + cmd[6] = cmd[7] = 0; + + if(send(s, cmd, 8, 0) != 8) { + perror("set host mode"); + return -1; + } + + if(recv(s, cmd, 8, 0) != 8) { + perror("set host mode"); + return -1; + } + +#ifdef DEBUG + printf("Set Host Mode: %02x %02x %02x %02x %02x %02x %02x %02x\n", + cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6], cmd[7]); +#endif + + return 8; +} + +static uint8_t buf[0x8000]; + +int connect_and_send(struct sockaddr_in *a, const char *fn, int ka) { + FILE *fp; + int s; + uint32_t crc = 0, size = 0, addr = 0, crc2 = 0; + + if(!(fp = fopen(fn, "rb"))) { + perror("Error opening file"); + return -1; + } + + if((s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { + perror("Create socket"); + fclose(fp); + return -2; + } + + if(connect(s, (struct sockaddr *)a, sizeof(struct sockaddr_in)) < 0) { + perror("Connect socket"); + close(s); + fclose(fp); + return -3; + } + + if(set_host_mode(s, 0, 1) < 0) { + fprintf(stderr, "Error setting host mode\n"); + close(s); + fclose(fp); + return -4; + } + + if(set_null_key(s) < 0) { + fprintf(stderr, "Error setting null key\n"); + close(s); + fclose(fp); + return -5; + } + + /* Send file */ + while(!feof(fp)) { + size = fread(buf, 1, 0x8000, fp); + if(size != 0) { + printf("%08x\n", addr); + if(upload_data(s, addr, size, buf) < 0) { + fprintf(stderr, "Error uploading data\n"); + close(s); + fclose(fp); + return -6; + } + + crc = crc32le(crc, buf, size); + + addr += size; + } + } + + printf("%08x\n", addr); + fclose(fp); + crc = ~crc; + + if(finalize_upload(s, addr) < 0) { + fprintf(stderr, "Error finalizing upload\n"); + close(s); + return -7; + } + + if(send_prog_info(s, crc, addr) < 0) { + fprintf(stderr, "Error sending program information\n"); + close(s); + return -8; + } + + if(send_restart_cmd(s) < 0) { + fprintf(stderr, "Error sending restart command\n"); + close(s); + return -9; + } + + if(set_time_limit(s, 10 * 60 * 1000) < 0) { + fprintf(stderr, "Error setting time limit\n"); + close(s); + return -10; + } + + printf("Entering Keep Alive Loop. CTRL + C will end the program.\n"); + /* If the keep alive flag is set, send a packet to the NetDIMM every few + seconds to keep it awake without a security PIC. */ + if(ka) { + sleep(20); + for(;;) { + set_time_limit(s, 10 * 60 * 1000); + sleep(5); + } + } + + close(s); + return 0; +} + +void usage(const char *progname) { + printf("Usage: %s -t ip -x prog\n\n", progname); + printf("Arguments:\n" + " -t ip - Specify the IP of the NAOMI.\n" + " -x prog - Load and execute the NAOMI rom file 'prog'.\n" + " -a - Attempt to keep the NAOMI awake without a PIC.\n"); +} + +int main(int argc, char *argv[]) { + int c; + struct sockaddr_in naomi_addr; + char *progfn = NULL; + int keepalive = 0; + + struct sigaction sa; + + memset(&sa, 0, sizeof(struct sigaction)); + sigemptyset(&sa.sa_mask); + + /* Ignore SIGPIPEs */ + sa.sa_handler = SIG_IGN; + + if(sigaction(SIGPIPE, &sa, NULL) == -1) { + perror("sigaction"); + exit(EXIT_FAILURE); + } + + memset(&naomi_addr, 0, sizeof(struct sockaddr_in)); + + /* Parse arguments. */ + while((c = getopt(argc, argv, ":t:x:a")) != -1) { + switch(c) { + case 't': + if(inet_pton(AF_INET, optarg, &naomi_addr.sin_addr) != 1) { + fprintf(stderr, "Invalid IP address specified.\n"); + goto err; + } + + naomi_addr.sin_family = AF_INET; + naomi_addr.sin_port = htons(NETDIMM_PORT); + + inet_ntop(AF_INET, &naomi_addr.sin_addr, buf, INET6_ADDRSTRLEN); + break; + + case 'x': + if(progfn) { + fprintf(stderr, "Ignoring duplicate -x argument.\n"); + break; + } + + if(!(progfn = strdup(optarg))) { + perror("strdup"); + goto err; + } + break; + + case 'a': + keepalive = 1; + break; + + case '?': + fprintf(stderr, "Unrecognized option: '-%c'\n", optopt); + goto err; + + case ':': + fprintf(stderr, "Option -%c requires an argument\n", optopt); + goto err; + } + } + + /* Make sure we got all the requisite arguments */ + if(!naomi_addr.sin_family) { + fprintf(stderr, "You must specify the IP address of the NAOMI.\n"); + goto err; + } + else if(!progfn) { + fprintf(stderr, "You must specify a binary to upload.\n"); + goto err; + } + + c = connect_and_send(&naomi_addr, progfn, keepalive); + free(progfn); + return c < 0 ? EXIT_FAILURE: 0; + +err: + if(progfn) + free(progfn); + + return EXIT_FAILURE; +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-09 00:45:04
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 500cab7a308b483bcfcf8b1d05d307583d440308 (commit) from d84b193e9e3417bd4194b2762cf727560d21386a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 500cab7a308b483bcfcf8b1d05d307583d440308 Author: Lawrence Sebald <ljs...@us...> Date: Tue Sep 8 20:44:37 2020 -0400 Add elf parsing to naomibintool for building binaries. ----------------------------------------------------------------------- Summary of changes: utils/naomibintool/Makefile | 4 +- utils/naomibintool/naomibintool.c | 227 +++++++++++++++++++++++++++++++++++++- 2 files changed, 224 insertions(+), 7 deletions(-) diff --git a/utils/naomibintool/Makefile b/utils/naomibintool/Makefile index f9317a2..8313a82 100644 --- a/utils/naomibintool/Makefile +++ b/utils/naomibintool/Makefile @@ -6,8 +6,8 @@ all: naomibintool -naomibin: naomibintool.c - $(CC) -o naomibintool naomibintool.c +naomibintool: naomibintool.c + $(CC) -o naomibintool naomibintool.c -lelf clean: -rm -f naomibintool diff --git a/utils/naomibintool/naomibintool.c b/utils/naomibintool/naomibintool.c index c86338a..4feee5e 100644 --- a/utils/naomibintool/naomibintool.c +++ b/utils/naomibintool/naomibintool.c @@ -13,6 +13,15 @@ #include <stddef.h> #include <inttypes.h> #include <unistd.h> +#include <fcntl.h> + +#ifndef NO_LIBELF +#include <libelf.h> + +#ifndef O_BINARY +#define O_BINARY 0 +#endif +#endif #define NAOMI_REGION_JAPAN 0 #define NAOMI_REGION_USA 1 @@ -140,6 +149,11 @@ void usage(const char *progname) { " address is 0x8c020000.\n" " -s addr - Specify the entry point address\n" " (default: 0x8c020000).\n" +#ifndef NO_LIBELF + " -e file - Specify an ELF binary to pack into rom. The\n" + " load address will be detected automatically,\n" + " as will the entry point.\n" +#endif "Note: Currently only one bin can be packed into a rom.\n" "This will be fixed in a future version of this tool.\n"); } @@ -246,12 +260,188 @@ static int write_rom_bin(naomi_hdr_t *hdr, const char fn[], FILE *bin) { return 0; } +#ifndef NO_LIBELF +static int write_rom_elf(naomi_hdr_t *hdr, const char fn[], int bin) { + FILE *fp; + size_t sz, sz2; + Elf *e; + Elf32_Ehdr *ehdr; + Elf32_Shdr *shdr; + Elf_Scn *section = NULL; + Elf_Data *data; + Elf32_Word arch; + size_t index; + char *sn; + uint32_t base = 0; + long off; + + if(elf_version(EV_CURRENT) == EV_NONE) { + fprintf(stderr, "Error initializing libelf: %s\n", elf_errmsg(-1)); + return EXIT_FAILURE; + } + + if((e = elf_begin(bin, ELF_C_READ, NULL)) == NULL) { + fprintf(stderr, "Error reading ELF: %s\n", elf_errmsg(-1)); + return EXIT_FAILURE; + } + + if(elf_kind(e) != ELF_K_ELF) { + fprintf(stderr, "Specified file is not an ELF binary.\n"); + elf_end(e); + return EXIT_FAILURE; + } + + if(!(ehdr = elf32_getehdr(e))) { + fprintf(stderr, "Unable to read ELF32 header: %s\n", elf_errmsg(-1)); + elf_end(e); + return EXIT_FAILURE; + } + + if(ehdr->e_machine != EM_SH) { + fprintf(stderr, "Binary is not a SuperH ELF file.\n"); + elf_end(e); + return EXIT_FAILURE; + } + + if(ehdr->e_ident[EI_CLASS] != ELFCLASS32) { + fprintf(stderr, "Binary is not a 32-bit ELF.\n"); + elf_end(e); + return EXIT_FAILURE; + } + + if(ehdr->e_ident[EI_DATA] != ELFDATA2LSB) { + fprintf(stderr, "Binary is not little endian.\n"); + elf_end(e); + return EXIT_FAILURE; + } + + arch = ehdr->e_flags & EF_SH_MACH_MASK; + if(arch != EF_SH4 && arch != EF_SH4_NOFPU && arch != EF_SH_UNKNOWN && + arch != EF_SH4A && arch != EF_SH4A_NOFPU && arch != EF_SH4_NOMMU_NOFPU) { + fprintf(stderr, "Binary is not compiled for SH4.\n"); + elf_end(e); + return EXIT_FAILURE; + } + + if(!(fp = fopen(fn, "wb"))) { + perror("Cannot open file for writing"); + return EXIT_FAILURE; + } + + if(fseek(fp, 0x1000, SEEK_SET) < 0) { + perror("Cannot write file"); + fclose(fp); + return EXIT_FAILURE; + } + + hdr->entry = ehdr->e_entry; + hdr->test_entry = ehdr->e_entry; + printf("Entry point is 0x%08" PRIx32 "\n", hdr->entry); + + if(elf_getshdrstrndx(e, &index)) { + fprintf(stderr, "Unable to read section index: %s\n", elf_errmsg(-1)); + elf_end(e); + fclose(fp); + return EXIT_FAILURE; + } + + /* Go through each section and add it to the binary. */ + while((section = elf_nextscn(e, section))) { + if(!(shdr = elf32_getshdr(section))) { + fprintf(stderr, "Unable to read section header: %s\n", + elf_errmsg(-1)); + elf_end(e); + fclose(fp); + return EXIT_FAILURE; + } + + if(!(sn = elf_strptr(e, index, shdr->sh_name))) { + fprintf(stderr, "Unable to read section name: %s\n", + elf_errmsg(-1)); + elf_end(e); + fclose(fp); + return EXIT_FAILURE; + } + + if(!shdr->sh_addr) + continue; + + data = elf_getdata(section, NULL); + if(!data->d_buf || !data->d_size) + continue; + + printf("Section %-20s Address: 0x%08" PRIx32 ", size: %d\n", + sn, shdr->sh_addr, shdr->sh_size); + + if(base == 0) { + base = shdr->sh_addr; + hdr->segment[0].ram_offset = base; + hdr->test_segment[0].ram_offset = base; + } + + if(shdr->sh_addr < base) { + fprintf(stderr, "Section has invalid address\n"); + elf_end(e); + fclose(fp); + return EXIT_FAILURE; + } + + /* Move to the right place in our output binary... */ + if(fseek(fp, 0x1000 + shdr->sh_addr - base, SEEK_SET) < 0) { + perror("Cannot write file"); + elf_end(e); + fclose(fp); + return EXIT_FAILURE; + } + + do { + if(fwrite(data->d_buf, 1, data->d_size, fp) != data->d_size) { + fprintf(stderr, "Cannot write file.\n"); + elf_end(e); + fclose(fp); + return EXIT_FAILURE; + } + } while((data = elf_getdata(section, data))); + } + + elf_end(e); + + /* Figure out how much we wrote into the binary. */ + off = ftell(fp) - 0x1000; + hdr->segment[0].rom_offset = 0x1000; + hdr->segment[0].ram_offset = base; + hdr->segment[0].size = (uint32_t)off; + hdr->test_segment[0].rom_offset = 0x1000; + hdr->test_segment[0].ram_offset = base; + hdr->test_segment[0].size = (uint32_t)off; + + /* Rewind to the beginning to write the header. */ + if(fseek(fp, 0, SEEK_SET) < 0) { + perror("Cannot write file"); + fclose(fp); + return EXIT_FAILURE; + } + + if(fwrite(hdr, sizeof(naomi_hdr_t), 1, fp) != 1) { + perror("Cannot write file"); + fclose(fp); + return EXIT_FAILURE; + } + + fclose(fp); + + printf("Successfully wrote rom file.\n"); + return 0; +} +#endif /* !NO_LIBELF */ + int build_rom(int argc, char *argv[]) { char *argv2[argc - 2]; int i, j, k; naomi_hdr_t hdr; char *tmp, *tmp2; FILE *binfile = NULL; + int elffile = -1; /* Clear the header and set some reasonable defaults... */ memset(&hdr, 0, sizeof(naomi_hdr_t)); @@ -290,7 +480,7 @@ int build_rom(int argc, char *argv[]) { } /* Parse arguments. */ - while((i = getopt(argc - 2, argv2, "p:d:t:b:s:")) != -1) { + while((i = getopt(argc - 2, argv2, "p:d:t:b:s:e:")) != -1) { switch(i) { case 'p': j = strlen(optarg); @@ -371,7 +561,7 @@ int build_rom(int argc, char *argv[]) { break; case 'b': - if(binfile) { + if(binfile || elffile >= 0) { fprintf(stderr, "Cannot load multiple binaries!\n"); goto err; } @@ -403,6 +593,25 @@ int build_rom(int argc, char *argv[]) { hdr.test_segment[0].size = hdr.segment[0].size; break; + case 'e': +#ifdef NO_LIBELF + fprintf(stderr, "-e option requires libelf.\n"); + return EXIT_FAILURE; +#else + if(binfile || elffile >= 0) { + fprintf(stderr, "Cannot load multiple binaries!\n"); + goto err; + } + + elffile = open(optarg, O_BINARY | O_RDONLY); + if(elffile < 0) { + perror("Cannot open binary"); + return EXIT_FAILURE; + } + + break; +#endif + case '?': fprintf(stderr, "Unrecognized option: '-%c'\n", optopt); goto err; @@ -414,14 +623,22 @@ int build_rom(int argc, char *argv[]) { } /* Did we get a binary? */ - if(!binfile) { + if(!binfile && elffile < 0) { fprintf(stderr, "You must specify a binary to pack into the rom!\n"); return EXIT_FAILURE; } /* Write out our binary... */ - i = write_rom_bin(&hdr, argv[2], binfile); - fclose(binfile); + if(binfile) { + i = write_rom_bin(&hdr, argv[2], binfile); + fclose(binfile); + } +#ifndef NO_LIBELF + else { + i = write_rom_elf(&hdr, argv[2], elffile); + close(elffile); + } +#endif return i; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-08 03:29:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via d84b193e9e3417bd4194b2762cf727560d21386a (commit) from 9e21c516db1433c0c11e4e9ae6d9ce3a1c21ef1c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d84b193e9e3417bd4194b2762cf727560d21386a Author: Lawrence Sebald <ljs...@us...> Date: Mon Sep 7 23:28:30 2020 -0400 Add built naomibintool to the .gitignore. ----------------------------------------------------------------------- Summary of changes: .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8f219c2..b2b6a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ utils/gentexfont/gentexfont utils/isotest/isotest utils/makejitter/makejitter utils/dcbumpgen/dcbumpgen +utils/naomibintool/naomibintool examples/dreamcast/basic/exec/romdisk/sub.bin examples/dreamcast/kgl/basic/vq/fruit.vq examples/dreamcast/conio/adventure/data.c hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-08 03:07:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 9e21c516db1433c0c11e4e9ae6d9ce3a1c21ef1c (commit) from 324daa5daf2fcb7c8292c343541624fdd891c042 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9e21c516db1433c0c11e4e9ae6d9ce3a1c21ef1c Author: Lawrence Sebald <ljs...@us...> Date: Mon Sep 7 23:07:11 2020 -0400 Build naomibintool with the rest of utils. ----------------------------------------------------------------------- Summary of changes: utils/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/Makefile b/utils/Makefile index c00cad0..3b6707d 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -4,7 +4,7 @@ # (c)2001 Dan Potter # -DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip +DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip naomibintool # Ok for these to fail atm... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-08 03:06:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 324daa5daf2fcb7c8292c343541624fdd891c042 (commit) from 5c80a7620356fbcff0542632668435746bf94ed2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 324daa5daf2fcb7c8292c343541624fdd891c042 Author: Lawrence Sebald <ljs...@us...> Date: Mon Sep 7 23:05:32 2020 -0400 Add binary building to the naomi bin tool. ----------------------------------------------------------------------- Summary of changes: utils/naomibintool/naomibintool.c | 280 +++++++++++++++++++++++++++++++++++++- 1 file changed, 279 insertions(+), 1 deletion(-) diff --git a/utils/naomibintool/naomibintool.c b/utils/naomibintool/naomibintool.c index b321c57..c86338a 100644 --- a/utils/naomibintool/naomibintool.c +++ b/utils/naomibintool/naomibintool.c @@ -12,6 +12,7 @@ #include <stdint.h> #include <stddef.h> #include <inttypes.h> +#include <unistd.h> #define NAOMI_REGION_JAPAN 0 #define NAOMI_REGION_USA 1 @@ -19,6 +20,12 @@ #define NAOMI_REGION_KOREA 3 #define NAOMI_REGION_AUSTRALIA 4 +#define DEFAULT_PLATFORM "NAOMI " +#define DEFAULT_DEVELOPER "Anonymous Developer " +#define DEFAULT_TITLE "Homebrew Application " +#define DEFAULT_SEQ1 "CREDIT TO START " +#define DEFAULT_SEQ2 "CREDIT TO CONTINUE " + typedef struct naomi_segment { uint32_t rom_offset; uint32_t ram_offset; @@ -119,7 +126,22 @@ static void print_entries(const naomi_hdr_t *hdr) { void usage(const char *progname) { printf("Usage: %s oper filename [args]\n\n", progname); printf("Where oper is one of the following:\n" - " read -- Reads the header binary and prints out information.\n"); + " read -- Reads the ROM header and prints out information.\n" + " build -- Builds a ROM from the specified arguments.\n\n" + "Arguments for the build operation:\n" + " -p name - Specify the platform for the rom\n" + " (default: \"NAOMI\").\n" + " -d name - Specify the developer of the rom.\n" + " -t name[:regn] - Specify the title of the rom for a the given\n" + " region number. If no number is given, the\n" + " title is used for all regions.\n" + " -b file[:addr] - Specify a binary to pack into rom, and\n" + " optionally the address to load to. The default\n" + " address is 0x8c020000.\n" + " -s addr - Specify the entry point address\n" + " (default: 0x8c020000).\n" + "Note: Currently only one bin can be packed into a rom.\n" + "This will be fixed in a future version of this tool.\n"); } int read_header(int argc, char *argv[]) { @@ -157,6 +179,259 @@ int read_header(int argc, char *argv[]) { return 0; } +static long get_filesize(FILE *fp) { + long len; + + if(fseek(fp, 0, SEEK_END) < 0) { + perror("Cannot read binary"); + return EXIT_FAILURE; + } + + len = ftell(fp); + + if(fseek(fp, 0, SEEK_SET) < 0) { + perror("Cannot read binary"); + return EXIT_FAILURE; + } + + return len; +} + +#define BUF_SIZE 4096 +static uint8_t buf[BUF_SIZE]; + +static int write_rom_bin(naomi_hdr_t *hdr, const char fn[], FILE *bin) { + FILE *fp; + size_t sz, sz2; + + if(!(fp = fopen(fn, "wb"))) { + perror("Cannot open file for writing"); + return EXIT_FAILURE; + } + + if(fwrite(hdr, sizeof(naomi_hdr_t), 1, fp) != 1) { + perror("Cannot write file"); + fclose(fp); + return EXIT_FAILURE; + } + + if(fseek(fp, 0x1000, SEEK_SET) < 0) { + perror("Cannot write file"); + fclose(fp); + return EXIT_FAILURE; + } + + do { + sz = fread(buf, 1, BUF_SIZE, bin); + if(!sz) { + if(ferror(bin)) { + perror("Cannot read binary"); + fclose(fp); + return EXIT_FAILURE; + } + } + else { + sz2 = fwrite(buf, 1, sz, fp); + if(!sz2) { + perror("Cannot write file"); + fclose(fp); + return EXIT_FAILURE; + } + } + } while(sz); + + fclose(fp); + + printf("Successfully wrote rom file.\n"); + return 0; +} + +int build_rom(int argc, char *argv[]) { + char *argv2[argc - 2]; + int i, j, k; + naomi_hdr_t hdr; + char *tmp, *tmp2; + FILE *binfile = NULL; + + /* Clear the header and set some reasonable defaults... */ + memset(&hdr, 0, sizeof(naomi_hdr_t)); + memcpy(hdr.signature, DEFAULT_PLATFORM, 16); + memcpy(hdr.developer, DEFAULT_DEVELOPER, 32); + for(i = 0; i < 8; ++i) { + memcpy(hdr.region_title[i], DEFAULT_TITLE, 32); + } + + hdr.mfg_year = 1999; + hdr.mfg_month = 9; + hdr.mfg_day = 9; + + hdr.serial_number[0] = hdr.serial_number[1] = hdr.serial_number[2] = + hdr.serial_number[3] = 'X'; + + memcpy(hdr.sequence_text[0], DEFAULT_SEQ1, 32); + memcpy(hdr.sequence_text[1], DEFAULT_SEQ2, 32); + + hdr.entry = 0x8c020000; + hdr.test_entry = 0x8c020000; + hdr.segment[0].rom_offset = 0x1000; + hdr.segment[0].ram_offset = 0x8c020000; + hdr.segment[1].rom_offset = 0xFFFFFFFF; + hdr.test_segment[0].rom_offset = 0x1000; + hdr.test_segment[0].ram_offset = 0x8c020000; + hdr.test_segment[1].rom_offset = 0xFFFFFFFF; + hdr.supported_regions = 0xFF; + memset(hdr.padding, 0xFF, 71); + hdr.encrypted = 0xFF; + + /* Shift off the "build" command and the filename. */ + argv2[0] = argv[0]; + for(i = 3; i < argc; ++i) { + argv2[i - 2] = argv[i]; + } + + /* Parse arguments. */ + while((i = getopt(argc - 2, argv2, "p:d:t:b:s:")) != -1) { + switch(i) { + case 'p': + j = strlen(optarg); + if(j > 16) { + fprintf(stderr, "Invalid platform name: '%s'\n", optarg); + goto err; + } + + memcpy(hdr.signature, optarg, j); + while(j < 16) + hdr.signature[j++] = ' '; + break; + + case 'd': + j = strlen(optarg); + if(j > 32) { + fprintf(stderr, "Invalid developer name: '%s'\n", optarg); + goto err; + } + + memcpy(hdr.developer, optarg, j); + while(j < 32) + hdr.developer[j++] = ' '; + break; + + case 't': + /* Do we have a region number? */ + tmp = strdup(optarg); + k = -1; + + if((tmp2 = strchr(tmp, ':'))) { + *tmp2++ = 0; + errno = 0; + k = (int)strtol(tmp2, NULL, 10); + + if(errno || k < 0 || k > 7) { + fprintf(stderr, "Invalid region number: '%s'\n", tmp2); + free(tmp); + goto err; + } + } + + j = strlen(tmp); + if(j > 32) { + fprintf(stderr, "Invalid title: '%s'\n", tmp); + free(tmp); + goto err; + } + + if(k != -1) { + memcpy(hdr.region_title[k], tmp, j); + while(j < 32) + hdr.region_title[k][j++] = ' '; + } + else { + memcpy(hdr.region_title[0], tmp, j); + while(j < 32) + hdr.region_title[0][j++] = ' '; + + for(k = 1; k < 8; ++k) { + memcpy(hdr.region_title[k], hdr.region_title[0], 32); + } + } + + free(tmp); + break; + + case 's': + errno = 0; + hdr.entry = (uint32_t)strtoul(optarg, NULL, 16); + + if(errno) { + fprintf(stderr, "Invalid entry point: '%s'", optarg); + goto err; + } + + hdr.test_entry = hdr.entry; + break; + + case 'b': + if(binfile) { + fprintf(stderr, "Cannot load multiple binaries!\n"); + goto err; + } + + /* Do we have a load address? */ + tmp = strdup(optarg); + if((tmp2 = strchr(tmp, ':'))) { + *tmp2 = 0; + errno = 0; + hdr.segment[0].ram_offset = + (uint32_t)strtoul(tmp2, NULL, 16); + hdr.test_segment[0].ram_offset = hdr.segment[0].ram_offset; + + if(errno) { + fprintf(stderr, "Invalid load address: '%s'\n", tmp2); + free(tmp); + return EXIT_FAILURE; + } + } + + binfile = fopen(tmp, "rb"); + free(tmp); + if(!binfile) { + perror("Cannot open binary"); + return EXIT_FAILURE; + } + + hdr.segment[0].size = (uint32_t)get_filesize(binfile); + hdr.test_segment[0].size = hdr.segment[0].size; + break; + + case '?': + fprintf(stderr, "Unrecognized option: '-%c'\n", optopt); + goto err; + + case ':': + fprintf(stderr, "Option -%c requires an argument\n", optopt); + goto err; + } + } + + /* Did we get a binary? */ + if(!binfile) { + fprintf(stderr, "You must specify a binary to pack into the rom!\n"); + return EXIT_FAILURE; + } + + /* Write out our binary... */ + i = write_rom_bin(&hdr, argv[2], binfile); + fclose(binfile); + + return i; + +err: + if(binfile) + fclose(binfile); + + return EXIT_FAILURE; +} + int main(int argc, char *argv[]) { if(argc < 3) { usage(argv[0]); @@ -166,6 +441,9 @@ int main(int argc, char *argv[]) { if(!strcmp(argv[1], "read")) { return read_header(argc, argv); } + else if(!strcmp(argv[1], "build")) { + return build_rom(argc, argv); + } usage(argv[0]); return EXIT_FAILURE; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-06 03:06:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated discards b139a36e096ab4d3521494cfb2610159e0d0183d (commit) via 5c80a7620356fbcff0542632668435746bf94ed2 (commit) This update added new revisions after undoing existing revisions. That is to say, the old revision is not a strict subset of the new revision. This situation occurs when you --force push a change and generate a repository containing something like this: * -- * -- B -- O -- O -- O (b139a36e096ab4d3521494cfb2610159e0d0183d) \ N -- N -- N (5c80a7620356fbcff0542632668435746bf94ed2) When this happens we assume that you've already had alert emails for all of the O revisions, and so we here report only the revisions in the N branch from the common base, B. Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5c80a7620356fbcff0542632668435746bf94ed2 Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 5 22:58:26 2020 -0400 Rewrite of naomibintool based on DragonMinded's documentation. ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-06 02:59:05
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via b139a36e096ab4d3521494cfb2610159e0d0183d (commit) from 6552e8b89c2f3a5652c22a4f13919978fdefc36b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b139a36e096ab4d3521494cfb2610159e0d0183d Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 5 22:58:26 2020 -0400 Rewrite of naomibintool based on DragnoMinded's documentation. ----------------------------------------------------------------------- Summary of changes: utils/naomibintool/naomibintool.c | 174 +++++++++++++++++++++++++------------- 1 file changed, 113 insertions(+), 61 deletions(-) diff --git a/utils/naomibintool/naomibintool.c b/utils/naomibintool/naomibintool.c index a959571..b321c57 100644 --- a/utils/naomibintool/naomibintool.c +++ b/utils/naomibintool/naomibintool.c @@ -1,6 +1,6 @@ /* KallistiOS ##version## - naomibin.c + naomibintool.c Copyright (C) 2020 Lawrence Sebald */ @@ -10,20 +10,70 @@ #include <string.h> #include <errno.h> #include <stdint.h> +#include <stddef.h> #include <inttypes.h> +#define NAOMI_REGION_JAPAN 0 +#define NAOMI_REGION_USA 1 +#define NAOMI_REGION_EXPORT 2 +#define NAOMI_REGION_KOREA 3 +#define NAOMI_REGION_AUSTRALIA 4 + +typedef struct naomi_segment { + uint32_t rom_offset; + uint32_t ram_offset; + uint32_t size; +} naomi_segment_t; + +/* NAOMI ROM header structure. Thanks to DragonMinded's documentation for the + data here (https://github.com/DragonMinded/netboot/blob/trunk/docs/naomi.md) + */ typedef struct naomi_hdr { char signature[16]; char developer[32]; char region_title[8][32]; + uint16_t mfg_year; + uint8_t mfg_month; + uint8_t mfg_day; + char serial_number[4]; + uint16_t eightmb_mode; + uint16_t g1_init; + uint32_t g1_rrc; + uint32_t g1_rwc; + uint32_t g1_frc; + uint32_t g1_fwc; + uint32_t g1_crc; + uint32_t g1_cwc; + uint32_t g1_gdrc; + uint32_t g1_gdwc; + uint8_t m2m4_checksum[132]; + struct { + uint8_t apply; + uint8_t system_settings; + uint8_t coin_chute; + uint8_t coin_setting; + uint8_t coin1_rate; + uint8_t coin2_rate; + uint8_t credit_rate; + uint8_t bonus_rate; + uint8_t seqtext_offset[8]; + } eeprom[8]; + char sequence_text[8][32]; + naomi_segment_t segment[8]; + naomi_segment_t test_segment[8]; + uint32_t entry; + uint32_t test_entry; + uint8_t supported_regions; + uint8_t supported_players; + uint8_t supported_display_freq; + uint8_t supported_display_dir; + uint8_t check_eeprom; + uint8_t service_type; + uint8_t m1_checksums[138]; + uint8_t padding[71]; + uint8_t encrypted; } naomi_hdr_t; -typedef struct naomi_segment { - uint32_t rom; - uint32_t ram; - uint32_t size; -} naomi_segment_t; - static void print_header(const naomi_hdr_t *hdr) { int i; @@ -35,86 +85,88 @@ static void print_header(const naomi_hdr_t *hdr) { } } -static naomi_segment_t *read_segments(FILE *fp, int *num_segments) { - int addr = 0x0360; - int ns = 0; - naomi_segment_t seg; - - fseek(fp, addr, SEEK_SET); - - while(addr < 0x0420) { - fread(&seg, sizeof(naomi_segment_t), 1, fp); +static void print_segments(const naomi_hdr_t *hdr) { + int i; - if(seg.size == 0 || (seg.rom & 0x80000000)) + for(i = 0; i < 8; ++i) { + if(hdr->segment[i].rom_offset == 0xFFFFFFFF) break; - printf("Segment %d\n", ns + 1); - printf("ROM Address: %08" PRIx32 "\n", seg.rom); - printf("RAM Address: %08" PRIx32 "\n", seg.ram); - printf("Length: %" PRIu32 "\n", seg.size); - addr += 12; - ++ns; + printf("Segment %d\n" + "ROM Offset: %08" PRIx32 "\n" + "RAM Offset: %08" PRIx32 "\n" + "Size: %" PRIu32 "\n", i + 1, hdr->segment[i].rom_offset, + hdr->segment[i].ram_offset, hdr->segment[i].size); } - *num_segments = ns; + for(i = 0; i < 8; ++i) { + if(hdr->test_segment[i].rom_offset == 0xFFFFFFFF) + break; - return NULL; + printf("Test Segment %d\n" + "ROM Offset: %08" PRIx32 "\n" + "RAM Offset: %08" PRIx32 "\n" + "Size: %" PRIu32 "\n", i + 1, hdr->test_segment[i].rom_offset, + hdr->test_segment[i].ram_offset, hdr->test_segment[i].size); + } } -static int read_entry(FILE *fp, uint32_t *entry, uint32_t *entry2) { - fseek(fp, 0x0420, SEEK_SET); - - fread(entry, sizeof(uint32_t), 1, fp); - fread(entry2, sizeof(uint32_t), 1, fp); - - printf("Entry point: %08" PRIx32 "\n", *entry); - printf("Reset point: %08" PRIx32 "\n", *entry2); - - return 0; +static void print_entries(const naomi_hdr_t *hdr) { + printf("Entry point: %08" PRIx32 "\n" + "Test Entry point: %08" PRIx32 "\n", hdr->entry, hdr->test_entry); } -static int read_interrupts(FILE *fp) { - uint32_t vec[22]; - int i; - - fseek(fp, 0x0130, SEEK_SET); - - for(i = 0; i < 22; ++i) { - fread(vec + i, sizeof(uint32_t), 1, fp); - printf("Vector %d: %08" PRIx32 "\n", i, vec[i]); - } - - return 0; +void usage(const char *progname) { + printf("Usage: %s oper filename [args]\n\n", progname); + printf("Where oper is one of the following:\n" + " read -- Reads the header binary and prints out information.\n"); } -int main(int argc, char *argv[]) { +int read_header(int argc, char *argv[]) { FILE *fp; naomi_hdr_t hdr; - int tmp; - uint32_t entry, reset; - if(argc != 2) { - fprintf(stderr, "Usage: %s filename\n", argv[0]); - exit(EXIT_FAILURE); + if(argc != 3) { + usage(argv[0]); + return EXIT_FAILURE; } - fp = fopen(argv[1], "rb"); - if(!fp) { + if(!(fp = fopen(argv[2], "rb"))) { perror("Error opening file"); - exit(EXIT_FAILURE); + return EXIT_FAILURE; } if(fread(&hdr, sizeof(naomi_hdr_t), 1, fp) != 1) { perror("Error reading file"); fclose(fp); - exit(EXIT_FAILURE); + return EXIT_FAILURE; + } + + fclose(fp); + + if(memcmp(hdr.signature, "NAOMI ", 16) && + memcmp(hdr.signature, "Naomi2 ", 16)) { + fprintf(stderr, "File does not appear to be a NAOMI/NAOMI2 ROM.\n"); + return EXIT_FAILURE; } print_header(&hdr); - read_segments(fp, &tmp); - read_entry(fp, &entry, &reset); - read_interrupts(fp); + print_segments(&hdr); + print_entries(&hdr); - fclose(fp); return 0; } + +int main(int argc, char *argv[]) { + if(argc < 3) { + usage(argv[0]); + exit(EXIT_FAILURE); + } + + if(!strcmp(argv[1], "read")) { + return read_header(argc, argv); + } + + usage(argv[0]); + return EXIT_FAILURE; +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-09-05 20:37:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 6552e8b89c2f3a5652c22a4f13919978fdefc36b (commit) from ce33885a8f23cc8e8cd970139b430591ea6c95fd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6552e8b89c2f3a5652c22a4f13919978fdefc36b Author: Lawrence Sebald <ljs...@us...> Date: Sat Sep 5 16:36:27 2020 -0400 Rename naomibin -> naomibintool. ----------------------------------------------------------------------- Summary of changes: utils/naomibin/Makefile | 13 ------------- utils/naomibintool/Makefile | 13 +++++++++++++ utils/{naomibin/naomibin.c => naomibintool/naomibintool.c} | 0 3 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 utils/naomibin/Makefile create mode 100644 utils/naomibintool/Makefile rename utils/{naomibin/naomibin.c => naomibintool/naomibintool.c} (100%) diff --git a/utils/naomibin/Makefile b/utils/naomibin/Makefile deleted file mode 100644 index afd184e..0000000 --- a/utils/naomibin/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# KallistiOS ##version## -# -# utils/naomibin/Makefile -# Copyright (C) 2020 Lawrence Sebald -# - -all: naomibin - -naomibin: naomibin.c - gcc -o naomibin naomibin.c - -clean: - -rm -f naomibin diff --git a/utils/naomibintool/Makefile b/utils/naomibintool/Makefile new file mode 100644 index 0000000..f9317a2 --- /dev/null +++ b/utils/naomibintool/Makefile @@ -0,0 +1,13 @@ +# KallistiOS ##version## +# +# utils/naomibintool/Makefile +# Copyright (C) 2020 Lawrence Sebald +# + +all: naomibintool + +naomibin: naomibintool.c + $(CC) -o naomibintool naomibintool.c + +clean: + -rm -f naomibintool diff --git a/utils/naomibin/naomibin.c b/utils/naomibintool/naomibintool.c similarity index 100% rename from utils/naomibin/naomibin.c rename to utils/naomibintool/naomibintool.c hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-08-27 13:13:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via ce33885a8f23cc8e8cd970139b430591ea6c95fd (commit) via ce9a738bf3819ac1cdf54b7181c6106628fdf1de (commit) via 84533739288de46e1cb4b3180d8d10545d83ba90 (commit) from a2964cecf4d1acf19f208f5827eda952f8818b05 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ce33885a8f23cc8e8cd970139b430591ea6c95fd Merge: a2964ce ce9a738 Author: Lawrence Sebald <ljs...@us...> Date: Thu Aug 27 09:11:54 2020 -0400 Merge pull request #45 from sizious/makeip-auto-build Build and install automatically makeip when building utils commit ce9a738bf3819ac1cdf54b7181c6106628fdf1de Author: SiZiOUS <si...@gm...> Date: Thu Aug 27 10:01:54 2020 +0200 The makeip binary is now installed in the "${KOS_BASE}/utils/makeip" directory. This follow the same rule of all the other utilities provided by KOS. This avoid the installation outside the ${KOS_BASE} directory. commit 84533739288de46e1cb4b3180d8d10545d83ba90 Author: SiZiOUS <si...@gm...> Date: Wed Aug 26 21:22:44 2020 +0200 makeip is now automatically built and installed when running make in the utils directory ----------------------------------------------------------------------- Summary of changes: utils/Makefile | 2 +- utils/makeip/Makefile | 10 ++++++++++ utils/makeip/src/Makefile | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 utils/makeip/Makefile diff --git a/utils/Makefile b/utils/Makefile index 392c0d9..c00cad0 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -4,7 +4,7 @@ # (c)2001 Dan Potter # -DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen +DIRS = genromfs wav2adpcm vqenc scramble dcbumpgen makeip # Ok for these to fail atm... diff --git a/utils/makeip/Makefile b/utils/makeip/Makefile new file mode 100644 index 0000000..9927869 --- /dev/null +++ b/utils/makeip/Makefile @@ -0,0 +1,10 @@ +MAKE ?= make + +all: + @cd ./src; \ + $(MAKE); \ + $(MAKE) install + +clean: + @cd ./src; \ + $(MAKE) clean diff --git a/utils/makeip/src/Makefile b/utils/makeip/src/Makefile index ff2c3f2..06e63fd 100644 --- a/utils/makeip/src/Makefile +++ b/utils/makeip/src/Makefile @@ -10,7 +10,7 @@ STRIP = strip CFLAGS = -O2 -Wall -DMAKEIP_VERSION=\"$(VERSION)\" -I/usr/local/include LDFLAGS = -L/usr/local/lib -lpng -lz -INSTALLDIR = $(KOS_BASE)/../bin +INSTALLDIR = .. EXECUTABLEEXTENSION = ifeq ($(shell echo $(OS)),Windows_NT) @@ -27,7 +27,7 @@ $(TARGET): $(OBJECTS) install: mkdir -p $(INSTALLDIR) - cp $(OUTPUT) $(INSTALLDIR) + mv $(OUTPUT) $(INSTALLDIR) .PHONY: clean clean: hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-08-22 15:56:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via a2964cecf4d1acf19f208f5827eda952f8818b05 (commit) from 4cc401b276210dbc471fa5953cd4f63e319422a8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a2964cecf4d1acf19f208f5827eda952f8818b05 Author: Lawrence Sebald <ljs...@us...> Date: Sat Aug 22 11:55:00 2020 -0400 Fix sem_init argument checking issue. Thanks to TapamN at DCEmulation for noticing the issue and proposing a fix. See this topic for more info: https://dcemulation.org/phpBB/viewtopic.php?f=29&t=105574 ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 58 +++++++++++++++++++++++++++++++++-------------------- kernel/thread/sem.c | 9 +++++++-- 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index a0f8af0..dd9a64d 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -18,15 +18,15 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Cleaned up warnings with -std=c99 for C code [LS] - DC Changed the PVR render-to-texture support to allow for two render-to- texture passes without an intervening render-to-screen pass [LS] -- *** Fixed an issue in fs_ext2 that would allow you to rename a directory to be - a child of itself, thus chopping it off from the rest of the directory - tree [LS] +- *** Fixed an issue in fs_ext2 that would allow you to rename a directory to + be a child of itself, thus chopping it off from the rest of the + directory tree [LS] - *** Added a fs_readlink() function to resolve symlinks [LS] - *** Fixed the vqenc and kmgenc utilities for compilation on a 64-bit OS [LS] - DC Corrected an issue with video cable detection with GCC 4.8.x [LS] - DC Added support for ATA devices on the G1 bus [LS] -- DC Fixed an infinite loop in ATA initialization if nothing except the GD-ROM - drive is connected [LS] +- DC Fixed an infinite loop in ATA initialization if nothing except the + GD-ROM drive is connected [LS] - *** Added documentation for the addons tree [LS] - DC Made the hardware auto-initialization/shutdown functions weakly linked so that they can be overridden without modifying KOS [LS] @@ -37,19 +37,19 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Modified the cdrom driver so that it will set itself as the active ATA device before trying to do any CD related reading [LS] - DC Fixed potential race conditions between the cdrom code and g1ata [LS] -- DC Fixed full sector reading of non-data CDs (thanks to SWAT for pointing out - that it needed fixing) [LS] +- DC Fixed full sector reading of non-data CDs (thanks to SWAT for pointing + out that it needed fixing) [LS] - DC Added many new matrix/vector math-related macros [Josh Pearson == JP] - *** Added libppp for dialup internet access to the addons tree [LS] - *** Added DNS resolver functions getaddrinfo() and gethostbyname() [LS] - *** Fixed a problem where poll() would deadlock if the timeout expired [LS] -- *** Modified getaddrinfo() so that it would try multiple times to contact the - DNS server with a timeout between messages [LS] +- *** Modified getaddrinfo() so that it would try multiple times to contact + the DNS server with a timeout between messages [LS] - DC Various cleanups and modifications to the cdrom code, including subcode - reading functionality, DMA-based sector reads, and using a recursive mutex - for the G1 lock [Donald Haase == DH] -- DC Fixed pvr_mem_available() to report all available texture memory, not just - what was available in the pvr_malloc() arena [LS] + reading functionality, DMA-based sector reads, and using a recursive + mutex for the G1 lock [Donald Haase == DH] +- DC Fixed pvr_mem_available() to report all available texture memory, not + just what was available in the pvr_malloc() arena [LS] - DC Added a utility function to the PVR code for controlling the cheap shadow scale register [LS] - DC Added an example of the PVR's cheap shadow functionality [LS] @@ -93,8 +93,8 @@ KallistiOS version 2.1.0 ----------------------------------------------- as it should be to ensure GCC doesn't mess with it any [LS] - DC Copy function data from maple device during hot-swap poll if already attached [Joe Fenton == JF] -- DC Fixed the clobber list of several matrix-related assembly blobs. Thanks to - kazade at DCEmulation for pointing out the issue [LS] +- DC Fixed the clobber list of several matrix-related assembly blobs. Thanks + to kazade at DCEmulation for pointing out the issue [LS] - *** Added the uname() function to retrieve the current kernel version [LS] - *** Added fs_fat for SD cards and g1ata devices [LS] - *** Added thd_each() function to iterate over all current threads [LB] @@ -104,17 +104,31 @@ KallistiOS version 2.1.0 ----------------------------------------------- - NAO Added preliminary support for compiling to target the NAOMI and NAOMI 2 arcade systems with a NetDIMM board attached [LS] - NAO Added a simple utility to parse NetDIMM binary header data [LS] -- DC Fixed AICA crash when volume is set to 255 [AB == Andress Barajas] -- DC Placed a cap on the amount of samples requested by AICA so we don't get a - Buffer overflow [AB] +- DC Fixed AICA crash when volume is set to 255 [Andress Barajas == AB] +- DC Placed a cap on the amount of samples requested by AICA so we don't get + a Buffer overflow [AB] - DC Added a very simple minifont and an example of its use [LS] - NAO Added a NAOMI-specific version of fb_console using minifont [LS] -- NAO Cleaned up the build process to not build certain parts of the DC hardware - support that are either not useful or not (yet?) functional on NAOMI [LS] +- NAO Cleaned up the build process to not build certain parts of the DC + hardware support that are either not useful or not (yet?) functional on + NAOMI [LS] - DC Fixed fs_path_append unsafe pointer arithmetic and made it smarter [AB] -- DC Fixed fs_ramdisk_attach so it does not cut off the first character of filename when - attaching [AB] +- DC Fixed fs_ramdisk_attach so it does not cut off the first character of + filename when attaching [AB] - DC Moved max open file constants for CD, Ramdisk, Romdisk to opts.h [AB] +- DC Removed stale lwIP examples [LS] +- DC Removed fs_dclnative declarations from opts.h [LS] +- DC Ported lwIP/httpd example to the built-in network stack [LS] +- DC Added functions to set the icon and color of a VMU that is shown in + the BIOS menu, as well as functionality to read the VMU icons from the + BIOS font [AB] +- DC Added a function to draw an XBM image on a single VMU screen [AB] +- *** Fixed issues with erasing long file name entries and empty files in + libkosfat [Thomas Sowell == TS] +- *** Updated time_t to be 64-bits on Newlib 3.0 and later and fixed Newlib's + type for ino_t to be sensible in Newlib 3.3.0 patch [TS, LS] +- *** Fixed argument check in sem_init. Thanks to TapamN at DCEmulation for + noticing the issue and proposing the fix [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/kernel/thread/sem.c b/kernel/thread/sem.c index 271ebbe..4a4a542 100644 --- a/kernel/thread/sem.c +++ b/kernel/thread/sem.c @@ -2,7 +2,7 @@ sem.c Copyright (C) 2001, 2002, 2003 Dan Potter - Copyright (C) 2012 Lawrence Sebald + Copyright (C) 2012, 2020 Lawrence Sebald */ /* Defines semaphores */ @@ -49,7 +49,12 @@ semaphore_t *sem_create(int value) { } int sem_init(semaphore_t *sm, int count) { - if(sm->count < 0) { + if(!sm) { + errno = EFAULT; + return -1; + } + else if(count < 0) { + sm->initialized = 0; errno = EINVAL; return -1; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-07-24 02:27:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 4cc401b276210dbc471fa5953cd4f63e319422a8 (commit) from d50dd457bbdde503bd4928ae61d5ce05ff41646f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4cc401b276210dbc471fa5953cd4f63e319422a8 Author: Lawrence Sebald <ljs...@us...> Date: Thu Jul 23 22:26:39 2020 -0400 Fix Newlib 3.3.0 patch to use a sensible type for ino_t. ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/patches/newlib-3.3.0-kos.diff | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/utils/dc-chain/patches/newlib-3.3.0-kos.diff b/utils/dc-chain/patches/newlib-3.3.0-kos.diff index 72091d0..df0357b 100644 --- a/utils/dc-chain/patches/newlib-3.3.0-kos.diff +++ b/utils/dc-chain/patches/newlib-3.3.0-kos.diff @@ -1,17 +1,17 @@ diff -ruN newlib-3.3.0/newlib/configure.host newlib-3.3.0-kos/newlib/configure.host --- newlib-3.3.0/newlib/configure.host 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/configure.host 2020-03-27 22:02:19.871619000 -0400 ++++ newlib-3.3.0-kos/newlib/configure.host 2020-07-23 22:13:45.290000000 -0400 @@ -319,6 +319,7 @@ ;; sh | sh64) machine_dir=sh -+ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DMALLOC_PROVIDED -DABORT_PROVIDED -DHAVE_FCNTL -ffunction-sections -fdata-sections" ++ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DMALLOC_PROVIDED -DABORT_PROVIDED -DHAVE_FCNTL -ffunction-sections -fdata-sections" ;; sparc*) machine_dir=sparc diff -ruN newlib-3.3.0/newlib/libc/include/assert.h newlib-3.3.0-kos/newlib/libc/include/assert.h --- newlib-3.3.0/newlib/libc/include/assert.h 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/include/assert.h 2020-03-27 22:02:19.881254900 -0400 ++++ newlib-3.3.0-kos/newlib/libc/include/assert.h 2020-07-23 22:03:41.500000000 -0400 @@ -13,8 +13,8 @@ #ifdef NDEBUG /* required by ANSI standard */ # define assert(__e) ((void)0) @@ -40,7 +40,7 @@ diff -ruN newlib-3.3.0/newlib/libc/include/assert.h newlib-3.3.0-kos/newlib/libc # define static_assert _Static_assert diff -ruN newlib-3.3.0/newlib/libc/include/sys/_pthreadtypes.h newlib-3.3.0-kos/newlib/libc/include/sys/_pthreadtypes.h --- newlib-3.3.0/newlib/libc/include/sys/_pthreadtypes.h 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/include/sys/_pthreadtypes.h 2020-03-27 22:02:19.889184700 -0400 ++++ newlib-3.3.0-kos/newlib/libc/include/sys/_pthreadtypes.h 2020-07-23 22:03:41.500000000 -0400 @@ -22,16 +22,6 @@ #include <sys/sched.h> @@ -189,7 +189,7 @@ diff -ruN newlib-3.3.0/newlib/libc/include/sys/_pthreadtypes.h newlib-3.3.0-kos/ #endif /* ! _SYS__PTHREADTYPES_H_ */ diff -ruN newlib-3.3.0/newlib/libc/include/sys/signal.h newlib-3.3.0-kos/newlib/libc/include/sys/signal.h --- newlib-3.3.0/newlib/libc/include/sys/signal.h 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/include/sys/signal.h 2020-03-27 22:21:56.606133100 -0400 ++++ newlib-3.3.0-kos/newlib/libc/include/sys/signal.h 2020-07-23 22:03:41.500000000 -0400 @@ -222,9 +222,11 @@ int sigaltstack (const stack_t *__restrict, stack_t *__restrict); #endif @@ -202,9 +202,21 @@ diff -ruN newlib-3.3.0/newlib/libc/include/sys/signal.h newlib-3.3.0-kos/newlib/ #if __POSIX_VISIBLE >= 199309 +diff -ruN newlib-3.3.0/newlib/libc/include/sys/_types.h newlib-3.3.0-kos/newlib/libc/include/sys/_types.h +--- newlib-3.3.0/newlib/libc/include/sys/_types.h 2020-01-22 05:05:51.000000000 -0500 ++++ newlib-3.3.0-kos/newlib/libc/include/sys/_types.h 2020-07-23 22:10:56.850000000 -0400 +@@ -69,7 +69,7 @@ + + #ifndef __machine_ino_t_defined + #if (defined(__i386__) && (defined(GO32) || defined(__MSDOS__))) || \ +- defined(__sparc__) || defined(__SPU__) ++ defined(__sparc__) || defined(__SPU__) || defined(__sh__) + typedef unsigned long __ino_t; + #else + typedef unsigned short __ino_t; diff -ruN newlib-3.3.0/newlib/libc/stdlib/assert.c newlib-3.3.0-kos/newlib/libc/stdlib/assert.c --- newlib-3.3.0/newlib/libc/stdlib/assert.c 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/stdlib/assert.c 2020-03-27 22:02:19.897512100 -0400 ++++ newlib-3.3.0-kos/newlib/libc/stdlib/assert.c 2020-07-23 22:03:41.500000000 -0400 @@ -47,6 +47,8 @@ #include <stdlib.h> #include <stdio.h> @@ -222,7 +234,7 @@ diff -ruN newlib-3.3.0/newlib/libc/stdlib/assert.c newlib-3.3.0-kos/newlib/libc/ + diff -ruN newlib-3.3.0/newlib/libc/sys/sh/ftruncate.c newlib-3.3.0-kos/newlib/libc/sys/sh/ftruncate.c --- newlib-3.3.0/newlib/libc/sys/sh/ftruncate.c 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/sys/sh/ftruncate.c 2020-03-27 22:02:19.906576300 -0400 ++++ newlib-3.3.0-kos/newlib/libc/sys/sh/ftruncate.c 2020-07-23 22:03:41.500000000 -0400 @@ -1,9 +1,2 @@ -#include <_ansi.h> -#include <sys/types.h> @@ -236,7 +248,7 @@ diff -ruN newlib-3.3.0/newlib/libc/sys/sh/ftruncate.c newlib-3.3.0-kos/newlib/li -} diff -ruN newlib-3.3.0/newlib/libc/sys/sh/sys/lock.h newlib-3.3.0-kos/newlib/libc/sys/sh/sys/lock.h --- newlib-3.3.0/newlib/libc/sys/sh/sys/lock.h 1969-12-31 19:00:00.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/sys/sh/sys/lock.h 2020-03-27 22:02:19.914739900 -0400 ++++ newlib-3.3.0-kos/newlib/libc/sys/sh/sys/lock.h 2020-07-23 22:03:41.500000000 -0400 @@ -0,0 +1,52 @@ +/* KallistiOS ##version## + @@ -292,7 +304,7 @@ diff -ruN newlib-3.3.0/newlib/libc/sys/sh/sys/lock.h newlib-3.3.0-kos/newlib/lib + diff -ruN newlib-3.3.0/newlib/libc/sys/sh/syscalls.c newlib-3.3.0-kos/newlib/libc/sys/sh/syscalls.c --- newlib-3.3.0/newlib/libc/sys/sh/syscalls.c 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/sys/sh/syscalls.c 2020-03-27 22:02:19.921894600 -0400 ++++ newlib-3.3.0-kos/newlib/libc/sys/sh/syscalls.c 2020-07-23 22:03:41.500000000 -0400 @@ -1,228 +1,3 @@ -#include <_ansi.h> -#include <sys/types.h> @@ -526,7 +538,7 @@ diff -ruN newlib-3.3.0/newlib/libc/sys/sh/syscalls.c newlib-3.3.0-kos/newlib/lib -} diff -ruN newlib-3.3.0/newlib/libc/sys/sh/trap.S newlib-3.3.0-kos/newlib/libc/sys/sh/trap.S --- newlib-3.3.0/newlib/libc/sys/sh/trap.S 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/sys/sh/trap.S 2020-03-27 22:02:19.928023800 -0400 ++++ newlib-3.3.0-kos/newlib/libc/sys/sh/trap.S 2020-07-23 22:03:41.500000000 -0400 @@ -1,43 +0,0 @@ -#if __SH5__ - .mode SHmedia @@ -573,7 +585,7 @@ diff -ruN newlib-3.3.0/newlib/libc/sys/sh/trap.S newlib-3.3.0-kos/newlib/libc/sy -#endif /* ! __SH5__ */ diff -ruN newlib-3.3.0/newlib/libc/sys/sh/truncate.c newlib-3.3.0-kos/newlib/libc/sys/sh/truncate.c --- newlib-3.3.0/newlib/libc/sys/sh/truncate.c 2020-01-22 05:05:51.000000000 -0500 -+++ newlib-3.3.0-kos/newlib/libc/sys/sh/truncate.c 2020-03-27 22:02:19.932553000 -0400 ++++ newlib-3.3.0-kos/newlib/libc/sys/sh/truncate.c 2020-07-23 22:03:41.500000000 -0400 @@ -1,9 +1,2 @@ -#include <_ansi.h> -#include <sys/types.h> hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-07-24 02:01:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via d50dd457bbdde503bd4928ae61d5ce05ff41646f (commit) from 06bb113b77f338d529b929cb08c463ad459ff19a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d50dd457bbdde503bd4928ae61d5ce05ff41646f Author: Lawrence Sebald <ljs...@us...> Date: Thu Jul 23 22:01:10 2020 -0400 Make time_t 64-bits on Newlib 3.0 and newer. Newlib made the changeover in the 3.0.0 release, so make sure we match. ----------------------------------------------------------------------- Summary of changes: include/sys/_types.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/sys/_types.h b/include/sys/_types.h index 71d68ce..59593de 100644 --- a/include/sys/_types.h +++ b/include/sys/_types.h @@ -13,6 +13,7 @@ __BEGIN_DECLS #include <sys/lock.h> +#include <newlib.h> // This part copied from newlib's sys/_types.h. #ifndef __off_t_defined @@ -127,7 +128,11 @@ typedef unsigned short __nlink_t; typedef long __suseconds_t; /* microseconds (signed) */ typedef unsigned long __useconds_t; /* microseconds (unsigned) */ +#if __NEWLIB__ > 3 +#define _TIME_T long long +#else #define _TIME_T_ long +#endif typedef _TIME_T_ __time_t; #ifndef __clockid_t_defined hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-07-19 01:31:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 06bb113b77f338d529b929cb08c463ad459ff19a (commit) via 938f6f8fee6b671465519e3081d91c49c47d3345 (commit) via 0dc4dd5a038eb04c664b40d6658c6a84edd6bade (commit) via 384139ad5acf40d7defcdcbc3dea988d26c3c06a (commit) via 7f9a2c4f24b5b90be7fa1c1df175c692e4630516 (commit) via 5533c6ff5ee018fcaca7203a394e3b864e09b4ad (commit) via d829caee965825b52c3c67dacc203de2810cf4f5 (commit) via 93405a7c6e57b2f0cd6e77b30116504e1919e30d (commit) via a5a347aa28014f2cbe26a4983fe8ac30526d6d72 (commit) from e98b6ab7e69a1328b2e99462d9414cdf0781220f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 06bb113b77f338d529b929cb08c463ad459ff19a Author: Lawrence Sebald <ljs...@us...> Date: Sat Jul 18 21:31:04 2020 -0400 Clean up formatting, rename BFONT_VICON_* -> BFONT_ICON_*, and fix NAOMI compilation of the vmu.c file. commit 938f6f8fee6b671465519e3081d91c49c47d3345 Merge: e98b6ab 0dc4dd5 Author: Lawrence Sebald <ljs...@us...> Date: Sat Jul 18 21:18:56 2020 -0400 Merge pull request #42 from andressbarajas/vmu_icons Added vmu functionality commit 0dc4dd5a038eb04c664b40d6658c6a84edd6bade Author: Andress Barajas <and...@gm...> Date: Fri Jul 17 22:31:28 2020 -0700 Preface with BFONT commit 384139ad5acf40d7defcdcbc3dea988d26c3c06a Merge: 7f9a2c4 e98b6ab Author: Andress Barajas <and...@gm...> Date: Mon Jul 6 22:58:18 2020 -0700 Merge remote-tracking branch 'upstream/master' into vmu_icons Get latest KOS Fat fixes commit 7f9a2c4f24b5b90be7fa1c1df175c692e4630516 Author: Andress Barajas <and...@gm...> Date: Sat Jul 4 01:40:34 2020 -0700 Use already existing vmu root functions commit 5533c6ff5ee018fcaca7203a394e3b864e09b4ad Author: Andress Barajas <and...@gm...> Date: Thu Jul 2 17:03:03 2020 -0700 Fix comment for vmu_set_custom_color() commit d829caee965825b52c3c67dacc203de2810cf4f5 Author: Andress Barajas <and...@gm...> Date: Thu Jul 2 10:34:47 2020 -0700 Added more clarification about icon data commit 93405a7c6e57b2f0cd6e77b30116504e1919e30d Author: Andress Barajas <and...@gm...> Date: Thu Jul 2 07:49:44 2020 -0700 Remove unneeded string.h commit a5a347aa28014f2cbe26a4983fe8ac30526d6d72 Author: Andress Barajas <and...@gm...> Date: Thu Jul 2 02:25:37 2020 -0700 Added vmu functionality ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/biosfont.c | 65 ++++---- kernel/arch/dreamcast/hardware/maple/vmu.c | 111 ++++++++++++-- kernel/arch/dreamcast/include/dc/biosfont.h | 215 +++++++++++++++++++++++---- kernel/arch/dreamcast/include/dc/maple/vmu.h | 58 ++++++++ 4 files changed, 373 insertions(+), 76 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/biosfont.c b/kernel/arch/dreamcast/hardware/biosfont.c index 8536b99..586fa17 100644 --- a/kernel/arch/dreamcast/hardware/biosfont.c +++ b/kernel/arch/dreamcast/hardware/biosfont.c @@ -42,10 +42,10 @@ static int bfont_32bit = 0; /* Select an encoding for Japanese (or disable) */ void bfont_set_encoding(uint8 enc) { - if(enc <= BFONT_CODE_RAW) + if(enc <= BFONT_CODE_RAW) bfont_code_mode = enc; else - assert_msg(0, "Unknown bfont encoding mode"); + assert_msg(0, "Unknown bfont encoding mode"); } /* Set the foreground color and return the old color */ @@ -62,8 +62,8 @@ uint32 bfont_set_background_color(uint32 c) { return rv; } -/* Set the font to draw in 32 or 16 bit mode. - Deprecated: This will only impact compat functions for now. +/* Set the font to draw in 32 or 16 bit mode. + Deprecated: This will only impact compat functions for now. Moving forward, the compat will be 16bit only. */ int bfont_set_32bit_mode(int on) { int rv = bfont_32bit; @@ -173,7 +173,7 @@ uint16 *bfont_draw_one_row(uint16 *b, uint16 word, uint8 opaque, uint32 fg, uint uint8 x; uint32 color = 0x0000; uint16 write16 = 0x0000; - uint16 oldcolor = *b; + uint16 oldcolor = *b; if ((bpp == 4)||(bpp == 8)) { /* For 4 or 8bpp we have to go 2 or 4 pixels at a time to properly write out in all cases. */ @@ -184,17 +184,17 @@ uint16 *bfont_draw_one_row(uint16 *b, uint16 word, uint8 opaque, uint32 fg, uint oldcolor = *b; write16 = 0x0000; } - + if(word & (0x0800 >> x)) write16 |= fg<<(bpp*(x%pix)); else { if(opaque) write16 |= bg<<(bpp*(x%pix)); else write16 |= oldcolor&(bMask<<(bpp*(x%pix))); } if(x%pix == (pix-1)) *b++ = write16; - } + } } - else {/* 16 or 32 */ - + else {/* 16 or 32 */ + for(x = 0; x < BFONT_THIN_WIDTH; x++, b++) { if(word & (0x0800 >> x)) color = fg; @@ -202,11 +202,11 @@ uint16 *bfont_draw_one_row(uint16 *b, uint16 word, uint8 opaque, uint32 fg, uint if(opaque) color = bg; else continue; } - if(bpp==16) *b = color & 0xffff; + if(bpp==16) *b = color & 0xffff; else if(bpp == 32) {*(uint32 *)b = color; b++;} } } - + return b; } @@ -214,23 +214,23 @@ unsigned char bfont_draw_ex(uint8 *buffer, uint32 bufwidth, uint32 fg, uint32 bg uint8 *ch; uint16 word; uint8 y; - + /* If they're requesting a wide char and in the wrong format, kick this out */ if (wide && (bfont_code_mode == BFONT_CODE_ISO8859_1)) { dbglog(DBG_ERROR, "bfont_draw_ex: can't draw wide in bfont mode %d\n", bfont_code_mode); return 0; } - + /* Just making sure we can draw the character we want to */ if (bufwidth < (uint32)(BFONT_THIN_WIDTH*(wide+1))) { dbglog(DBG_ERROR, "bfont_draw_ex: buffer is too small to draw into\n"); return 0; - } - + } + /* Translate the character */ if (bfont_code_mode == BFONT_CODE_RAW) ch = get_font_address() + c; - else if (wide && ((bfont_code_mode == BFONT_CODE_EUC) || (bfont_code_mode == BFONT_CODE_SJIS))) + else if (wide && ((bfont_code_mode == BFONT_CODE_EUC) || (bfont_code_mode == BFONT_CODE_SJIS))) ch = bfont_find_char_jp(c); else { if(iskana) @@ -238,26 +238,26 @@ unsigned char bfont_draw_ex(uint8 *buffer, uint32 bufwidth, uint32 fg, uint32 bg else ch = bfont_find_char(c); } - + /* Increment over the height of the font. 3bytes at a time (2 thin or 1 wide row) */ for(y = 0; y < BFONT_HEIGHT; y+= (2-wide),ch+=((BFONT_THIN_WIDTH*2)/8)) { /* Do the first row, or half row */ word = (((uint16)ch[0]) << 4) | ((ch[1] >> 4) & 0x0f); buffer = (uint8*)bfont_draw_one_row((uint16*)buffer, word, opaque, fg, bg, bpp); - + /* If we're thin, increment to next row, otherwise continue the row */ if(!wide) buffer += ((bufwidth - BFONT_THIN_WIDTH)*bpp)/8; - + /* Do the second row, or second half */ word = ((((uint16)ch[1]) << 8) & 0xf00) | ch[2]; buffer = (uint8*)bfont_draw_one_row((uint16*)buffer, word, opaque, fg, bg, bpp); - + /* Increment to the next row. */ if(!wide) buffer += ((bufwidth - BFONT_THIN_WIDTH)*bpp)/8; - else buffer += ((bufwidth - BFONT_WIDE_WIDTH)*bpp)/8; + else buffer += ((bufwidth - BFONT_WIDE_WIDTH)*bpp)/8; } - + /* Return the horizontal distance covered in bytes */ if (wide) return (BFONT_WIDE_WIDTH*bpp)/8; @@ -266,7 +266,7 @@ unsigned char bfont_draw_ex(uint8 *buffer, uint32 bufwidth, uint32 fg, uint32 bg } /* Draw half-width kana */ -unsigned char bfont_draw_thin(void *b, uint32 bufwidth, uint8 opaque, uint32 c, uint8 iskana) { +unsigned char bfont_draw_thin(void *b, uint32 bufwidth, uint8 opaque, uint32 c, uint8 iskana) { return bfont_draw_ex((uint8 *)b, bufwidth, bfont_fgcolor, bfont_bgcolor, (bfont_32bit ? (sizeof (uint32)) : (sizeof (uint16))) << 3, opaque, c, 0, iskana); } @@ -282,12 +282,12 @@ unsigned char bfont_draw_wide(void *b, uint32 bufwidth, uint8 opaque, uint32 c) /* Draw string of full-width (wide) and half-width (thin) characters Note that this handles the case of mixed encodings unless Japanese - support is disabled (BFONT_CODE_ISO8859_1). - XXX: Seems like this can be shrunk to use uint8 for nChr/Mask/Flag and + support is disabled (BFONT_CODE_ISO8859_1). + XXX: Seems like this can be shrunk to use uint8 for nChr/Mask/Flag and getting rid of nMask. */ void bfont_draw_str_ex(void *b, uint32 width, uint32 fg, uint32 bg, uint8 bpp, uint8 opaque, char *str) { - uint16 nChr, nMask, nFlag; + uint16 nChr, nMask, nFlag; uint8 *buffer = (uint8 *)b; while(*str) { @@ -325,10 +325,10 @@ void bfont_draw_str_ex(void *b, uint32 width, uint32 fg, uint32 bg, uint8 bpp, u nChr = (nChr << 8) | (*str & 0xff); buffer += bfont_draw_ex(buffer, width, fg, bg, bpp, opaque, nChr, 1, 0); } - else + else buffer += bfont_draw_ex(buffer, width, fg, bg, bpp, opaque, nChr, 0, 1); } - else + else buffer += bfont_draw_ex(buffer, width, fg, bg, bpp, opaque, nChr, 0, 0); str++; @@ -339,3 +339,12 @@ void bfont_draw_str(void *b, uint32 width, uint8 opaque, char *str) { bfont_draw_str_ex(b, width, bfont_fgcolor, bfont_bgcolor, (bfont_32bit ? (sizeof (uint32)) : (sizeof (uint16))) << 3, opaque, str); } +uint8 *bfont_find_icon(uint8 icon) { + if(icon > BFONT_ICON_EMBROIDERY) + return NULL; + + int icon_offset = BFONT_VMU_DREAMCAST_SPECIFIC + + (icon * BFONT_ICON_DIMEN * BFONT_ICON_DIMEN/8); + uint8 *fa = get_font_address(); + return fa + icon_offset; +} diff --git a/kernel/arch/dreamcast/hardware/maple/vmu.c b/kernel/arch/dreamcast/hardware/maple/vmu.c index c916ab7..0089c3b 100644 --- a/kernel/arch/dreamcast/hardware/maple/vmu.c +++ b/kernel/arch/dreamcast/hardware/maple/vmu.c @@ -12,6 +12,8 @@ #include <kos/genwait.h> #include <dc/maple.h> #include <dc/maple/vmu.h> +#include <dc/biosfont.h> +#include <dc/vmufs.h> #include <arch/timer.h> /* @@ -45,6 +47,71 @@ void vmu_shutdown() { maple_driver_unreg(&vmu_drv); } +int vmu_use_custom_color(maple_device_t * dev, int enable) { + vmu_root_t root; + + if(vmufs_root_read(dev, &root) < 0) + return -1; + + /* 1 - Enables the use of the custom color. 0 - Disables */ + root.use_custom = (enable != 0) ? 1 : 0; + + if(vmufs_root_write(dev, &root) < 0) + return -1; + + return 0; +} + +/* The custom color is used while navigating the Dreamcast's file manager. + You set the RGBA parameters, each with valid range of 0-255 */ +int vmu_set_custom_color(maple_device_t * dev, uint8 red, uint8 green, uint8 blue, uint8 alpha) { + vmu_root_t root; + + if(vmufs_root_read(dev, &root) < 0) + return -1; + + /* 1 - Enables the use of the custom color. 0 - Disables */ + root.use_custom = 1; + root.custom_color[0] = blue; + root.custom_color[1] = green; + root.custom_color[2] = red; + root.custom_color[3] = alpha; + + if(vmufs_root_write(dev, &root) < 0) + return -1; + + return 0; +} + +/* The icon shape is used while navigating the BIOS menu. The values + for icon_shape are listed in the biosfont.h and start with + BFONT_ICON_VMUICON. */ +int vmu_set_icon_shape(maple_device_t * dev, uint8 icon_shape) { +#ifdef _arch_sub_naomi + vmu_root_t root; + + if(icon_shape < BFONT_ICON_VMUICON || icon_shape > BFONT_ICON_EMBROIDERY) + return -1; + + if(vmufs_root_read(dev, &root) < 0) + return -1; + + /* Valid value range is 0-123 and starts with BFONT_ICON_VMUICON which + has a value of 5. This is because we cant use the first 5 icons + found in the bios so we must subtract 5 */ + root.icon_shape = icon_shape - BFONT_ICON_VMUICON; + + if(vmufs_root_write(dev, &root) < 0) + return -1; + + return 0; +#else + (void)dev; + (void)icon_shape; + return -1; +#endif +} + /* These interfaces will probably change eventually, but for now they can stay the same */ @@ -137,6 +204,31 @@ int vmu_draw_lcd(maple_device_t * dev, void *bitmap) { return MAPLE_EOK; } +/* This function converts a xbm image to a 1-bit bitmap that can + be displayed on LCD screen of VMU */ +static void vmu_xbm_to_bitmap(uint8 *bitmap, const char *vmu_icon) { + int x, y, xi, xb; + memset(bitmap, 0, 48 * 32 / 8); + + if(vmu_icon) { + for(y = 0; y < 32; y++) + for(x = 0; x < 48; x++) { + xi = x / 8; + xb = 0x80 >> (x % 8); + + if(vmu_icon[(31 - y) * 48 + (47 - x)] == '.') + bitmap[y * (48 / 8) + xi] |= xb; + } + } +} + +int vmu_draw_lcd_xbm(maple_device_t * dev, const char *vmu_icon) { + uint8 bitmap[48 * 32 / 8]; + vmu_xbm_to_bitmap(bitmap, vmu_icon); + + return vmu_draw_lcd(dev, bitmap); +} + /* Read the data in block blocknum into buffer, return a -1 if an error occurs, for now we ignore MAPLE_RESPONSE_FILEERR, which will be changed shortly */ @@ -349,24 +441,11 @@ int vmu_block_write(maple_device_t * dev, uint16 blocknum, uint8 *buffer) { /* Utility function which sets the icon on all available VMUs from an Xwindows XBM. Imported from libdcutils. */ void vmu_set_icon(const char *vmu_icon) { - int x, y, xi, xb, i; - uint8 bitmap[48 * 32 / 8]; + int i = 0; maple_device_t * dev; + uint8 bitmap[48 * 32 / 8]; - memset(bitmap, 0, 48 * 32 / 8); - - if(vmu_icon) { - for(y = 0; y < 32; y++) - for(x = 0; x < 48; x++) { - xi = x / 8; - xb = 0x80 >> (x % 8); - - if(vmu_icon[(31 - y) * 48 + (47 - x)] == '.') - bitmap[y * (48 / 8) + xi] |= xb; - } - } - - i = 0; + vmu_xbm_to_bitmap(bitmap, vmu_icon); while((dev = maple_enum_type(i++, MAPLE_FUNC_LCD))) { vmu_draw_lcd(dev, bitmap); diff --git a/kernel/arch/dreamcast/include/dc/biosfont.h b/kernel/arch/dreamcast/include/dc/biosfont.h index 65cb10c..549dbe7 100644 --- a/kernel/arch/dreamcast/include/dc/biosfont.h +++ b/kernel/arch/dreamcast/include/dc/biosfont.h @@ -36,16 +36,16 @@ __BEGIN_DECLS /** @} */ #define JISX_0208_ROW_SIZE 94 -/** \defgroup bfont_indecies Structure of the Bios Font +/** \defgroup bfont_indecies Structure of the Bios Font @{ */ #define BFONT_NARROW_START 0 /**< \brief Start of Narrow Characters in Font Block */ -#define BFONT_OVERBAR BFONT_NARROW_START -#define BFONT_ISO_8859_1_33_126 BFONT_NARROW_START+( 1*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) -#define BFONT_YEN BFONT_NARROW_START+(95*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) -#define BFONT_ISO_8859_1_160_255 BFONT_NARROW_START+(96*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) +#define BFONT_OVERBAR BFONT_NARROW_START +#define BFONT_ISO_8859_1_33_126 BFONT_NARROW_START+( 1*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) +#define BFONT_YEN BFONT_NARROW_START+(95*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) +#define BFONT_ISO_8859_1_160_255 BFONT_NARROW_START+(96*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) -/* JISX-0208 Rows 1-7 and 16-84 are encoded between BFONT_WIDE_START and BFONT_DREAMCAST_SPECIFIC. +/* JISX-0208 Rows 1-7 and 16-84 are encoded between BFONT_WIDE_START and BFONT_DREAMCAST_SPECIFIC. Only the box-drawing characters (row 8) are missing. */ #define BFONT_WIDE_START (288*BFONT_THIN_WIDTH*BFONT_HEIGHT/8) /**< \brief Start of Wide Characters in Font Block */ #define BFONT_JISX_0208_ROW1 BFONT_WIDE_START /**< \brief Start of JISX-0208 Rows 1-7 in Font Block */ @@ -77,7 +77,138 @@ __BEGIN_DECLS #define BFONT_STARTBUTTON BFONT_DREAMCAST_SPECIFIC+(20*BFONT_WIDE_WIDTH*BFONT_HEIGHT/8) #define BFONT_VMUICON BFONT_DREAMCAST_SPECIFIC+(21*BFONT_WIDE_WIDTH*BFONT_HEIGHT/8) - +#define BFONT_ICON_DIMEN 32 /**< \brief Dimension of vmu icons */ +#define BFONT_VMU_DREAMCAST_SPECIFIC BFONT_DREAMCAST_SPECIFIC+(22*BFONT_WIDE_WIDTH*BFONT_HEIGHT/8) + +#define BFONT_ICON_INVALID_VMU 0x00 +#define BFONT_ICON_HOURGLASS_ONE 0x01 +#define BFONT_ICON_HOURGLASS_TWO 0x02 +#define BFONT_ICON_HOURGLASS_THREE 0x03 +#define BFONT_ICON_HOURGLASS_FOUR 0x04 +#define BFONT_ICON_VMUICON 0x05 +#define BFONT_ICON_EARTH 0x06 +#define BFONT_ICON_SATURN 0x07 +#define BFONT_ICON_QUARTER_MOON 0x08 +#define BFONT_ICON_LAUGHING_FACE 0x09 +#define BFONT_ICON_SMILING_FACE 0x0A +#define BFONT_ICON_CASUAL_FACE 0x0B +#define BFONT_ICON_ANGRY_FACE 0x0C +#define BFONT_ICON_COW 0x0D +#define BFONT_ICON_HORSE 0x0E +#define BFONT_ICON_RABBIT 0x0F +#define BFONT_ICON_CAT 0x10 +#define BFONT_ICON_CHICK 0x11 +#define BFONT_ICON_LION 0x12 +#define BFONT_ICON_MONKEY 0x13 +#define BFONT_ICON_PANDA 0x14 +#define BFONT_ICON_BEAR 0x15 +#define BFONT_ICON_PIG 0x16 +#define BFONT_ICON_DOG 0x17 +#define BFONT_ICON_FISH 0x18 +#define BFONT_ICON_OCTOPUS 0x19 +#define BFONT_ICON_SQUID 0x1A +#define BFONT_ICON_WHALE 0x1B +#define BFONT_ICON_CRAB 0x1C +#define BFONT_ICON_BUTTERFLY 0x1D +#define BFONT_ICON_LADYBUG 0x1E +#define BFONT_ICON_ANGLER_FISH 0x1F +#define BFONT_ICON_PENGUIN 0x20 +#define BFONT_ICON_CHERRIES 0x21 +#define BFONT_ICON_TULIP 0x22 +#define BFONT_ICON_LEAF 0x23 +#define BFONT_ICON_SAKURA 0x24 +#define BFONT_ICON_APPLE 0x25 +#define BFONT_ICON_ICECREAM 0x26 +#define BFONT_ICON_CACTUS 0x27 +#define BFONT_ICON_PIANO 0x28 +#define BFONT_ICON_GUITAR 0x29 +#define BFONT_ICON_EIGHTH_NOTE 0x2A +#define BFONT_ICON_TREBLE_CLEF 0x2B +#define BFONT_ICON_BOAT 0x2C +#define BFONT_ICON_CAR 0x2D +#define BFONT_ICON_HELMET 0x2E +#define BFONT_ICON_MOTORCYCLE 0x2F +#define BFONT_ICON_VAN 0x30 +#define BFONT_ICON_TRUCK 0x31 +#define BFONT_ICON_CLOCK 0x32 +#define BFONT_ICON_TELEPHONE 0x33 +#define BFONT_ICON_PENCIL 0x34 +#define BFONT_ICON_CUP 0x35 +#define BFONT_ICON_SILVERWARE 0x36 +#define BFONT_ICON_HOUSE 0x37 +#define BFONT_ICON_BELL 0x38 +#define BFONT_ICON_CROWN 0x39 +#define BFONT_ICON_SOCK 0x3A +#define BFONT_ICON_CAKE 0x3B +#define BFONT_ICON_KEY 0x3C +#define BFONT_ICON_BOOK 0x3D +#define BFONT_ICON_BASEBALL 0x3E +#define BFONT_ICON_SOCCER 0x3F +#define BFONT_ICON_BULB 0x40 +#define BFONT_ICON_TEDDY_BEAR 0x41 +#define BFONT_ICON_BOW_TIE 0x42 +#define BFONT_ICON_BOW_ARROW 0x43 +#define BFONT_ICON_SNOWMAN 0x44 +#define BFONT_ICON_LIGHTNING 0x45 +#define BFONT_ICON_SUN 0x46 +#define BFONT_ICON_CLOUD 0x47 +#define BFONT_ICON_UMBRELLA 0x48 +#define BFONT_ICON_ONE_STAR 0x49 +#define BFONT_ICON_TWO_STARS 0x4A +#define BFONT_ICON_THREE_STARS 0x4B +#define BFONT_ICON_FOUR_STARS 0x4C +#define BFONT_ICON_HEART 0x4D +#define BFONT_ICON_DIAMOND 0x4E +#define BFONT_ICON_SPADE 0x4F +#define BFONT_ICON_CLUB 0x50 +#define BFONT_ICON_JACK 0x51 +#define BFONT_ICON_QUEEN 0x52 +#define BFONT_ICON_KING 0x53 +#define BFONT_ICON_JOKER 0x54 +#define BFONT_ICON_ISLAND 0x55 +#define BFONT_ICON_0 0x56 +#define BFONT_ICON_1 0x57 +#define BFONT_ICON_2 0x58 +#define BFONT_ICON_3 0x59 +#define BFONT_ICON_4 0x5A +#define BFONT_ICON_5 0x5B +#define BFONT_ICON_6 0x5C +#define BFONT_ICON_7 0x5D +#define BFONT_ICON_8 0x5E +#define BFONT_ICON_9 0x5F +#define BFONT_ICON_A 0x60 +#define BFONT_ICON_B 0x61 +#define BFONT_ICON_C 0x62 +#define BFONT_ICON_D 0x63 +#define BFONT_ICON_E 0x64 +#define BFONT_ICON_F 0x65 +#define BFONT_ICON_G 0x66 +#define BFONT_ICON_H 0x67 +#define BFONT_ICON_I 0x68 +#define BFONT_ICON_J 0x69 +#define BFONT_ICON_K 0x6A +#define BFONT_ICON_L 0x6B +#define BFONT_ICON_M 0x6C +#define BFONT_ICON_N 0x6D +#define BFONT_ICON_O 0x6E +#define BFONT_ICON_P 0x6F +#define BFONT_ICON_Q 0x70 +#define BFONT_ICON_R 0x71 +#define BFONT_ICON_S 0x72 +#define BFONT_ICON_T 0x73 +#define BFONT_ICON_U 0x74 +#define BFONT_ICON_V 0x75 +#define BFONT_ICON_W 0x76 +#define BFONT_ICON_X 0x77 +#define BFONT_ICON_Y 0x78 +#define BFONT_ICON_Z 0x79 +#define BFONT_ICON_CHECKER_BOARD 0x7A +#define BFONT_ICON_GRID 0x7B +#define BFONT_ICON_LIGHT_GRAY 0x7C +#define BFONT_ICON_DIAG_GRID 0x7D +#define BFONT_ICON_PACMAN_GRID 0x7E +#define BFONT_ICON_DARK_GRAY 0x7F +#define BFONT_ICON_EMBROIDERY 0x80 /** @} */ @@ -111,7 +242,8 @@ uint32 bfont_set_background_color(uint32 c); \param on Set to 0 to use 16-bit color, 32-bit otherwise. \return The old state (1 = 32-bit, 0 = 16-bit). */ -int bfont_set_32bit_mode(int on) __depr("Please use the bpp function of the the bfont_draw_ex functions"); +int bfont_set_32bit_mode(int on) + __depr("Please use the bpp function of the the bfont_draw_ex functions"); ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-07-07 04:15:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via e98b6ab7e69a1328b2e99462d9414cdf0781220f (commit) via 3c28fd833df07e180f98e0955c600570e2f60d90 (commit) via 4a44115cc7db03bad2f83ba65cb037cc8ad92510 (commit) via a4fa4c9b24758d604e5c1cc4fc2246de23584466 (commit) from 921ec7f7e51d878cad495308506e08657ea11748 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e98b6ab7e69a1328b2e99462d9414cdf0781220f Merge: 921ec7f 3c28fd8 Author: Lawrence Sebald <ljs...@us...> Date: Tue Jul 7 00:13:46 2020 -0400 Merge pull request #44 from tsowell/libkosfat-fixes Libkosfat fixes commit 3c28fd833df07e180f98e0955c600570e2f60d90 Author: Thomas Sowell <to...@sh...> Date: Mon Jul 6 18:14:00 2020 -0800 libkosfat: Fix issue erasing long name entries fat_erase_dentry tries to move on to the next cluster after it finishes deleting a long name which causes an EIO. commit 4a44115cc7db03bad2f83ba65cb037cc8ad92510 Author: Thomas Sowell <to...@sh...> Date: Mon Jul 6 18:11:12 2020 -0800 libkosfat: Don't try to erase chain of empty files fat_erase_chain will loop forever if called with cluster=0 commit a4fa4c9b24758d604e5c1cc4fc2246de23584466 Author: Thomas Sowell <to...@sh...> Date: Mon Jun 1 14:32:35 2020 -0800 libkosfat: Fix cluster from fat_find_dentry ----------------------------------------------------------------------- Summary of changes: addons/libkosfat/directory.c | 64 +++++++++++++++++++++++--------------------- addons/libkosfat/fs_fat.c | 15 ++++++----- 2 files changed, 43 insertions(+), 36 deletions(-) diff --git a/addons/libkosfat/directory.c b/addons/libkosfat/directory.c index e71ec74..7625f06 100644 --- a/addons/libkosfat/directory.c +++ b/addons/libkosfat/directory.c @@ -594,7 +594,6 @@ int fat_find_dentry(fat_fs_t *fs, const char *fn, fat_dentry_t *rv, } tok = strtok_r(NULL, "/", &tmp); - cl = cur.cluster_low | (cur.cluster_high << 16); } /* One last check... If the filename the user passed in ends with a '/' @@ -698,39 +697,44 @@ int fat_erase_dentry(fat_fs_t *fs, uint32_t cl, uint32_t off, uint32_t lcl, ent->name[0] = FAT_ENTRY_FREE; } - /* Move onto the next cluster. */ - if(!(lcl & 0x80000000)) { - lcl = fat_read_fat(fs, lcl, &err); - if(lcl == 0xFFFFFFFF) { - dbglog(DBG_ERROR, "Invalid FAT value hit while reading long" - " name entry for deletion at cluster %" PRIu32 - ", offset %" PRIu32 "\n", lcl, i << 5); - return -err; - } - - /* This shouldn't happen either... */ - if(fat_is_eof(fs, lcl)) { - dbglog(DBG_ERROR, "End of directory hit while reading long " - "name entry for deletion at cluster %" PRIu32 - ", offset %" PRIu32 "\n", lcl, i << 5); - return -EIO; - } + if(!done) { + /* Move onto the next cluster. */ + if(!(lcl & 0x80000000)) { + lcl = fat_read_fat(fs, lcl, &err); + if(lcl == 0xFFFFFFFF) { + dbglog(DBG_ERROR, "Invalid FAT value hit while " + "reading long name entry for deletion at " + "cluster %" PRIu32 ", offset %" PRIu32 "\n", + lcl, i << 5); + return -err; + } - i = 0; - } - else { - ++lcl; - max2 -= max; + /* This shouldn't happen either... */ + if(fat_is_eof(fs, lcl)) { + dbglog(DBG_ERROR, "End of directory hit while " + "reading long name entry for deletion at " + "cluster %" PRIu32 ", offset %" PRIu32 "\n", + lcl, i << 5); + return -EIO; + } - if(max2 <= 0) { - dbglog(DBG_ERROR, "End of directory hit while reading long " - "name entry for deletion at cluster %" PRIu32 - ", offset %" PRIu32 "\n", lcl, i << 5); - return -EIO; + i = 0; } + else { + ++lcl; + max2 -= max; + + if(max2 <= 0) { + dbglog(DBG_ERROR, "End of directory hit while " + "reading long name entry for deletion at " + "cluster %" PRIu32 ", offset %" PRIu32 "\n", + lcl, i << 5); + return -EIO; + } - i = 0; - } + i = 0; + } + } } } diff --git a/addons/libkosfat/fs_fat.c b/addons/libkosfat/fs_fat.c index f6815b9..6c63bd8 100644 --- a/addons/libkosfat/fs_fat.c +++ b/addons/libkosfat/fs_fat.c @@ -1012,13 +1012,16 @@ static int fs_fat_unlink(vfs_handler_t *vfs, const char *fn) { return -1; } - /* First clean up the clusters of the file... */ + /* First clean up the clusters of the file... (if any) */ cluster = ent.cluster_low | (ent.cluster_high << 16); - if((err = fat_erase_chain(fs->fs, cluster))) { - /* Uh oh... This is really bad... */ - dbglog(DBG_ERROR, "fs_fat: Error erasing FAT chain for file %s\n", fn); - irv = -1; - errno = -err; + if(cluster != FAT_FREE_CLUSTER) { + if((err = fat_erase_chain(fs->fs, cluster))) { + /* Uh oh... This is really bad... */ + dbglog(DBG_ERROR, "fs_fat: Error erasing FAT chain for file %s\n", + fn); + irv = -1; + errno = -err; + } } /* Next, erase the directory entry (and long name, if applicable). */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: <ap...@us...> - 2020-06-30 21:42:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "An ethernet program loader for the Dreamcast.". The branch, experimental has been deleted was 98453cdb66c130dd6bfb6744bb5dda23a4b43be0 ----------------------------------------------------------------------- 98453cdb66c130dd6bfb6744bb5dda23a4b43be0 because nothing gets the file ext case change right ----------------------------------------------------------------------- hooks/post-receive -- An ethernet program loader for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-06-29 01:44:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 921ec7f7e51d878cad495308506e08657ea11748 (commit) via 020adc506a6ba0bc0c60ee9e2693cc77d1034f70 (commit) from 2c06d3cfe11fad0ddd5a4d63e5e146b2c1ca33aa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 921ec7f7e51d878cad495308506e08657ea11748 Author: Lawrence Sebald <ljs...@us...> Date: Sun Jun 28 21:43:50 2020 -0400 Fix network/httpd example to compile against the built-in network stack. This is completely untested at the moment, but it at least compiles. commit 020adc506a6ba0bc0c60ee9e2693cc77d1034f70 Author: Lawrence Sebald <ljs...@us...> Date: Sun Jun 28 21:35:29 2020 -0400 Move lwip/http example to the network examples directory. The example still needs fixing to remove lwip stuff from it, but it will end up here in the end. ----------------------------------------------------------------------- Summary of changes: .../dreamcast/{lwip => network}/httpd/Makefile | 16 +++-------- examples/dreamcast/{lwip => network}/httpd/httpd.c | 32 +++++++++++---------- .../{lwip => network}/httpd/romdisk/changelog.html | 0 .../httpd/romdisk/documentation.html | 0 .../{lwip => network}/httpd/romdisk/download.html | 0 .../{lwip => network}/httpd/romdisk/img/sics.gif | Bin .../{lwip => network}/httpd/romdisk/index.html | 0 .../{lwip => network}/httpd/romdisk/licence.html | 0 .../{lwip => network}/httpd/romdisk/links.html | 0 .../httpd/romdisk/mailinglist.html | 0 .../{lwip => network}/httpd/romdisk/news.html | 0 .../dreamcast/{lwip => network}/httpd/simhost.c | 8 ------ 12 files changed, 21 insertions(+), 35 deletions(-) rename examples/dreamcast/{lwip => network}/httpd/Makefile (59%) rename examples/dreamcast/{lwip => network}/httpd/httpd.c (95%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/changelog.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/documentation.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/download.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/img/sics.gif (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/index.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/licence.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/links.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/mailinglist.html (100%) rename examples/dreamcast/{lwip => network}/httpd/romdisk/news.html (100%) rename examples/dreamcast/{lwip => network}/httpd/simhost.c (93%) diff --git a/examples/dreamcast/lwip/httpd/Makefile b/examples/dreamcast/network/httpd/Makefile similarity index 59% rename from examples/dreamcast/lwip/httpd/Makefile rename to examples/dreamcast/network/httpd/Makefile index 470fcc7..82d30ea 100644 --- a/examples/dreamcast/lwip/httpd/Makefile +++ b/examples/dreamcast/network/httpd/Makefile @@ -1,7 +1,7 @@ # -# KallistiOS lwIP test program -# (c)2002 Dan Potter -# +# KallistiOS network/httpd example +# Copyright (C) 2002 Dan Potter +# # Put the filename of the output binary here TARGET = httpd.elf @@ -9,13 +9,6 @@ TARGET = httpd.elf # List all of your C files here, but change the extension to ".o" OBJS = simhost.o httpd.o romdisk.o -LWIPDIR = $(KOS_BASE)/../kos-ports/lwip/lwip/src -ARCHDIR = $(LWIPDIR)/../../kos - -KOS_CFLAGS += -DIPv4 \ - -I$(LWIPDIR)/include -I$(ARCHDIR)/include \ - -I$(LWIPDIR)/include/ipv4 - all: rm-elf $(TARGET) include $(KOS_BASE)/Makefile.rules @@ -27,8 +20,7 @@ rm-elf: rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -llwip4 -lkosutils $(KOS_LIBS) + kos-cc -o $(TARGET) $(OBJS) $(OBJEXTRA) romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v diff --git a/examples/dreamcast/lwip/httpd/httpd.c b/examples/dreamcast/network/httpd/httpd.c similarity index 95% rename from examples/dreamcast/lwip/httpd/httpd.c rename to examples/dreamcast/network/httpd/httpd.c index a56434b..d702064 100644 --- a/examples/dreamcast/lwip/httpd/httpd.c +++ b/examples/dreamcast/network/httpd/httpd.c @@ -4,10 +4,18 @@ Copyright (C)2003 Dan Potter */ -#include <lwip/lwip.h> -#include <lwip/sockets.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <sys/queue.h> +#include <sys/stat.h> + +#include <sys/socket.h> +#include <sys/select.h> +#include <netinet/in.h> + +#include <kos/thread.h> +#include <kos/mutex.h> struct http_state; typedef TAILQ_HEAD(http_state_list, http_state) http_state_list_t; @@ -19,17 +27,15 @@ typedef struct http_state { struct sockaddr_in client; socklen_t client_size; -// sys_thread_t thd; kthread_t * thd; } http_state_t; http_state_list_t states; #define st_foreach(var) TAILQ_FOREACH(var, &states, list) -mutex_t * list_mutex; +mutex_t list_mutex = MUTEX_INITIALIZER; int st_init() { TAILQ_INIT(&states); - list_mutex = mutex_create(); return 0; } @@ -37,31 +43,31 @@ http_state_t * st_create() { http_state_t * ns; ns = calloc(1, sizeof(http_state_t)); - mutex_lock(list_mutex); + mutex_lock(&list_mutex); TAILQ_INSERT_TAIL(&states, ns, list); - mutex_unlock(list_mutex); + mutex_unlock(&list_mutex); return ns; } void st_destroy(http_state_t *st) { - mutex_lock(list_mutex); + mutex_lock(&list_mutex); TAILQ_REMOVE(&states, st, list); - mutex_unlock(list_mutex); + mutex_unlock(&list_mutex); free(st); } int st_add_fds(fd_set * fds, int maxfd) { http_state_t * st; - mutex_lock(list_mutex); + mutex_lock(&list_mutex); st_foreach(st) { FD_SET(st->socket, fds); if(maxfd < (st->socket + 1)) maxfd = st->socket + 1; } - mutex_unlock(list_mutex); + mutex_unlock(&list_mutex); return maxfd; } @@ -226,7 +232,6 @@ void *client_thread(void *p) { const char * ct; file_t f = -1; int r, o, cnt; - stat_t st; printf("httpd: client thread started, sock %d\n", hs->socket); @@ -376,8 +381,6 @@ void httpd(void) { // Check for new incoming connections if(FD_ISSET(listenfd, &readset)) { - int tmp = 1; - hs = st_create(); hs->client_size = sizeof(hs->client); hs->socket = accept(listenfd, @@ -418,4 +421,3 @@ void httpd(void) { #endif } } - diff --git a/examples/dreamcast/lwip/httpd/romdisk/changelog.html b/examples/dreamcast/network/httpd/romdisk/changelog.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/changelog.html rename to examples/dreamcast/network/httpd/romdisk/changelog.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/documentation.html b/examples/dreamcast/network/httpd/romdisk/documentation.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/documentation.html rename to examples/dreamcast/network/httpd/romdisk/documentation.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/download.html b/examples/dreamcast/network/httpd/romdisk/download.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/download.html rename to examples/dreamcast/network/httpd/romdisk/download.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/img/sics.gif b/examples/dreamcast/network/httpd/romdisk/img/sics.gif similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/img/sics.gif rename to examples/dreamcast/network/httpd/romdisk/img/sics.gif diff --git a/examples/dreamcast/lwip/httpd/romdisk/index.html b/examples/dreamcast/network/httpd/romdisk/index.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/index.html rename to examples/dreamcast/network/httpd/romdisk/index.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/licence.html b/examples/dreamcast/network/httpd/romdisk/licence.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/licence.html rename to examples/dreamcast/network/httpd/romdisk/licence.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/links.html b/examples/dreamcast/network/httpd/romdisk/links.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/links.html rename to examples/dreamcast/network/httpd/romdisk/links.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/mailinglist.html b/examples/dreamcast/network/httpd/romdisk/mailinglist.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/mailinglist.html rename to examples/dreamcast/network/httpd/romdisk/mailinglist.html diff --git a/examples/dreamcast/lwip/httpd/romdisk/news.html b/examples/dreamcast/network/httpd/romdisk/news.html similarity index 100% rename from examples/dreamcast/lwip/httpd/romdisk/news.html rename to examples/dreamcast/network/httpd/romdisk/news.html diff --git a/examples/dreamcast/lwip/httpd/simhost.c b/examples/dreamcast/network/httpd/simhost.c similarity index 93% rename from examples/dreamcast/lwip/httpd/simhost.c rename to examples/dreamcast/network/httpd/simhost.c index ebe3465..2ae5a58 100644 --- a/examples/dreamcast/lwip/httpd/simhost.c +++ b/examples/dreamcast/network/httpd/simhost.c @@ -1,5 +1,3 @@ -#include <lwip/lwip.h> - #include <kos/thread.h> #include <dc/video.h> #include <dc/biosfont.h> @@ -17,7 +15,6 @@ void *do_httpd(void * foo) { } int main(int argc, char **argv) { - lwip_kos_init(); thd_create(1, do_httpd, NULL); vid_clear(50, 0, 70); @@ -37,8 +34,3 @@ int main(int argc, char **argv) { return 0; } - - - - - hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-06-29 01:30:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 2c06d3cfe11fad0ddd5a4d63e5e146b2c1ca33aa (commit) from 04f43435c2c0203fa8cbca3bc5b340f708213cc7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2c06d3cfe11fad0ddd5a4d63e5e146b2c1ca33aa Author: Lawrence Sebald <ljs...@us...> Date: Sun Jun 28 21:30:06 2020 -0400 Remove fs_dclnative stuff from kos/opts.h. ----------------------------------------------------------------------- Summary of changes: include/kos/opts.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/kos/opts.h b/include/kos/opts.h index f8e34c3..8b27c41 100644 --- a/include/kos/opts.h +++ b/include/kos/opts.h @@ -33,14 +33,6 @@ __BEGIN_DECLS /* Various debug options. Uncomment the #define line to enable the specific option described. */ -/* Enable debugging in fs_dclnative. This filesystem is deprecated, so there - probably won't be any good reason to enable these two. The first prints a bit - of debugging data, whereas the second prints out all packets received and - transmitted as well. You must uncomment the first in order for the second to - have any effect. */ -/* #define DCLN_DEBUG 1 */ -/* #define DCLN_DEBUG_VERBOSE 1 */ - /* Enable debugging in fs_vmu. */ /* #define VMUFS_DEBUG 1 */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2020-06-29 01:29:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 04f43435c2c0203fa8cbca3bc5b340f708213cc7 (commit) from e2f90c1bfed59585029a09cb23454b70477b38d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 04f43435c2c0203fa8cbca3bc5b340f708213cc7 Author: Lawrence Sebald <ljs...@us...> Date: Sun Jun 28 21:29:01 2020 -0400 Remove lwip/dcload-ip-lwip-test and lwip/dns-client examples. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/lwip/Makefile | 19 ---------- .../dreamcast/lwip/dcload-ip-lwip-test/Makefile | 27 -------------- examples/dreamcast/lwip/dcload-ip-lwip-test/main.c | 42 ---------------------- examples/dreamcast/lwip/dns-client/Makefile | 29 --------------- examples/dreamcast/lwip/dns-client/dnslookup.c | 38 -------------------- 5 files changed, 155 deletions(-) delete mode 100644 examples/dreamcast/lwip/Makefile delete mode 100644 examples/dreamcast/lwip/dcload-ip-lwip-test/Makefile delete mode 100644 examples/dreamcast/lwip/dcload-ip-lwip-test/main.c delete mode 100644 examples/dreamcast/lwip/dns-client/Makefile delete mode 100644 examples/dreamcast/lwip/dns-client/dnslookup.c diff --git a/examples/dreamcast/lwip/Makefile b/examples/dreamcast/lwip/Makefile deleted file mode 100644 index 8fd5b87..0000000 --- a/examples/dreamcast/lwip/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# KallistiOS ##version## -# -# examples/dreamcast/lwip/Makefile -# - -all: - $(KOS_MAKE) -C dns-client - $(KOS_MAKE) -C httpd -# $(KOS_MAKE) -C dcload-ip-lwip-test - -clean: - $(KOS_MAKE) -C dns-client clean - $(KOS_MAKE) -C httpd clean -# $(KOS_MAKE) -C dcload-ip-lwip-test clean - -dist: - $(KOS_MAKE) -C dns-client dist - $(KOS_MAKE) -C httpd dist -# $(KOS_MAKE) -C dcload-ip-lwip-test dist diff --git a/examples/dreamcast/lwip/dcload-ip-lwip-test/Makefile b/examples/dreamcast/lwip/dcload-ip-lwip-test/Makefile deleted file mode 100644 index f50f624..0000000 --- a/examples/dreamcast/lwip/dcload-ip-lwip-test/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -TARGET = dcload-lwip.elf - -OBJS = main.o - -LWIPDIR := $(KOS_BASE)/addons/lwip/src -LWIPARCH := kos -KOS_CFLAGS := $(KOS_CFLAGS) -DIPv4 -DLWIP_DEBUG \ - -I$(LWIPDIR)/include -I$(LWIPDIR)/arch/$(LWIPARCH)/include \ - -I$(LWIPDIR)/include/ipv4 -I$(LWIPDIR)/.. - -all: rm-elf $(TARGET) - -include $(KOS_BASE)/Makefile.rules - -clean: - -rm -f $(TARGET) $(OBJS) romdisk.* - -rm-elf: - -rm -f $(TARGET) romdisk.* - -$(TARGET): $(OBJS) - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -llwip4 $(KOS_LIBS) - -dist: - rm -f $(OBJS) - $(KOS_STRIP) $(TARGET) diff --git a/examples/dreamcast/lwip/dcload-ip-lwip-test/main.c b/examples/dreamcast/lwip/dcload-ip-lwip-test/main.c deleted file mode 100644 index 1080fd8..0000000 --- a/examples/dreamcast/lwip/dcload-ip-lwip-test/main.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <kos.h> -#include <lwip/lwip.h> - -KOS_INIT_FLAGS(INIT_DEFAULT | INIT_NET); - -int main(int argc, char **argv) { - file_t d; - dirent_t *de; - - cont_btn_callback(0, CONT_START, (cont_btn_callback_t)arch_exit); - - lwip_init_dcload(); - - printf("this is a test of dcload-lwIP\n"); - - d = fs_open("/pc", O_RDONLY | O_DIR); - - if(d == 0) { - printf("Can't open /pc\r\n"); - return 0; - } - - while((de = fs_readdir(d))) { - printf("%s / ", de->name); - - if(de->size >= 0) { - printf("%d\r\n", de->size); - } - else { - printf("DIR\r\n"); - } - } - - fs_close(d); - - return 0; -} - - - - - diff --git a/examples/dreamcast/lwip/dns-client/Makefile b/examples/dreamcast/lwip/dns-client/Makefile deleted file mode 100644 index d09d5d3..0000000 --- a/examples/dreamcast/lwip/dns-client/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -# Put the filename of the output binary here -TARGET = dns-client.elf - -# List all of your C files here, but change the extension to ".o" -OBJS = dnslookup.o - -LWIPDIR = $(KOS_BASE)/../kos-ports/lwip/lwip/src -ARCHDIR = $(LWIPDIR)/../../kos - -all: rm-elf $(TARGET) - -include $(KOS_BASE)/Makefile.rules - -KOS_CFLAGS += -DIPv4 \ - -I$(LWIPDIR)/include -I$(ARCHDIR)/include \ - -I$(LWIPDIR)/include/ipv4 - -clean: - rm -f $(TARGET) $(OBJS) - -rm-elf: - rm -f $(TARGET) - -$(TARGET): $(OBJS) - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -llwip4 -lkosutils $(KOS_LIBS) - -run: $(TARGET) - dc-tool -n -x $(TARGET) diff --git a/examples/dreamcast/lwip/dns-client/dnslookup.c b/examples/dreamcast/lwip/dns-client/dnslookup.c deleted file mode 100644 index 7120ee2..0000000 --- a/examples/dreamcast/lwip/dns-client/dnslookup.c +++ /dev/null @@ -1,38 +0,0 @@ -/* KallistiOS ##version## - - dnslookup.c - Copyright (C)2004 Dan Potter - - Test DNS lookup util. - -*/ - -// Use these for KOS usage. -#include <kos.h> -#include <lwip/lwip.h> - -#include <stdio.h> - -int main(int argc, char **argv) { - uint8 ip[4]; - struct sockaddr_in dnssrv; - - // KOS code - net_init(); - lwip_kos_init(); - - // Do the query - dnssrv.sin_family = AF_INET; - dnssrv.sin_port = htons(53); - dnssrv.sin_addr.s_addr = htonl(0x0a030202); - - if(lwip_gethostbyname(&dnssrv, "www.allusion.net", ip) < 0) - perror("Can't look up name"); - else { - printf("www.allusion.net is %d.%d.%d.%d\n", - ip[0], ip[1], ip[2], ip[3]); - } - - return 0; -} - hooks/post-receive -- A pseudo Operating System for the Dreamcast. |