Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce hat030 and replace ARANYM with WITH_NATIVE_FEATURES #253

Merged
merged 3 commits into from
Jul 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scripts/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fi
sed -i -e "s/xaloadtargets = 000 02060 030 040 060 col/xaloadtargets = ${TEMP_CPU_TARGET}/;" ./xaaes/src.km/xaloader/XALOADDEFS
sed -i -e "s/xaaestargets = deb 000 sto 030 040 060 col 02060/xaaestargets = ${XAAES_TARGETS}/;" ./xaaes/src.km/XAAESDEFS
sed -i -e "s/moosetargets = 02060 030 040 060 deb 000 col/moosetargets = ${TEMP_CPU_TARGET}/;" ./xaaes/src.km/adi/whlmoose/MOOSEDEFS
sed -i -e "s/kerneltargets = 000 020 030 040 060 deb mil ara hat col/kerneltargets = ${KERNEL_TARGETS}/;" ./sys/KERNELDEFS
sed -i -e "s/kerneltargets = 000 020 030 040 060 deb mil ara hat hat030 col/kerneltargets = ${KERNEL_TARGETS}/;" ./sys/KERNELDEFS
sed -i -e "s/ext2targets = 02060 030 040 060 deb 000 col/ext2targets = ${TEMP_CPU_TARGET}/;" ./sys/xfs/ext2fs/EXT2DEFS
sed -i -e "s/nfstargets = 02060 030 040 060 deb 000 col/nfstargets = ${TEMP_CPU_TARGET}/;" ./sys/xfs/nfs/NFSDEFS
sed -i -e "s/minixtargets = 02060 030 040 060 deb 000 col/minixtargets = ${TEMP_CPU_TARGET}/;" ./sys/xfs/minixfs/MINIXDEFS
Expand Down
5 changes: 4 additions & 1 deletion .scripts/kernel_targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ then
KERNEL_TARGETS="000 hat"
elif [ "$CPU_TARGET" = "02060" ]
then
KERNEL_TARGETS="020 030 040 060 mil ara"
KERNEL_TARGETS="020 030 040 060 mil ara hat030"
elif [ "$CPU_TARGET" = "030" ]
then
KERNEL_TARGETS="030 hat030"
elif [ "$CPU_TARGET" = "040" ]
then
KERNEL_TARGETS="040 mil ara"
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ all-here:
# default definitions

# kernel targets (repeated here from sys/KERNELDEFS)
kerneltargets = 000 020 030 040 060 deb mil ara hat
kerneltargets = 000 020 030 040 060 deb mil ara hat hat030
ifeq ($(COLDFIRE),yes)
kerneltargets += col
endif

000 020 030 040 060 deb mil col ara hat sockets xdd xfs usb all-kernels::
000 020 030 040 060 deb mil col ara hat hat030 sockets xdd xfs usb all-kernels::
$(MAKE) -C sys $@

000 020 030 040 060 deb mil col ara hat all-kernels::
000 020 030 040 060 deb mil col ara hat hat030 all-kernels::
$(MAKE) -C xaaes $@

all-recursive::
Expand Down
30 changes: 18 additions & 12 deletions sys/KERNELDEFS
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#
# generic flags
#
# -DVERBOSE_BOOT include extensive messages
# -DCRYPTO_CODE include the cryptographic filesystem stuff
# -DSOFT_UNITABLE loadable unicode tables
# -DBUILTIN_SHELL include the built-in minimal shell
# -DWITH_MMU_SUPPORT include MMU support
# -DPCI_BIOS include PCI_BIOS interface emulation
# -DVERBOSE_BOOT include extensive messages
# -DCRYPTO_CODE include the cryptographic filesystem stuff
# -DSOFT_UNITABLE loadable unicode tables
# -DBUILTIN_SHELL include the built-in minimal shell
# -DWITH_MMU_SUPPORT include MMU support
# -DPCI_BIOS include PCI_BIOS interface emulation
# -DWITH_NATIVE_FEATURES include native features detection

#
# machine flags
Expand All @@ -17,7 +18,6 @@
# -DM68040 build for 68040-060
# -DM68060 build for 68060
# -DMILAN build Milan kernel
# -DARANYM build Aranym kernel

#
# debug flags
Expand Down Expand Up @@ -67,7 +67,7 @@ endif
ifeq ($(kernel),030)
MINT = mint030.prg
CPU = 030
KERNELDEFS = -DM68030 -DWITH_NATIVE_FEATURES
KERNELDEFS = -DM68030
endif

ifeq ($(kernel),040)
Expand Down Expand Up @@ -111,17 +111,23 @@ endif
ifeq ($(kernel),ara)
MINT = mintara.prg
CPU = 040
KERNELDEFS = -DARANYM -DM68040 -DWITH_HOSTFS -DBOOTSTRAPABLE
KERNELDEFS = -DM68040 -DWITH_HOSTFS -DBOOTSTRAPABLE -DWITH_NATIVE_FEATURES
MODULEDIRS = xfs/hostfs
endif

ifeq ($(kernel),hat)
MINT = minthat.prg
MINT = mint000h.prg
CPU = 000
KERNELDEFS = -DM68000 -DOLDTOSFS -DNO_RAMFS -DNO_FAKE_SUPER -DNO_DEV_RANDOM
KERNELDEFS = -DM68000 -DOLDTOSFS -DNO_RAMFS -DNO_FAKE_SUPER -DNO_DEV_RANDOM -DWITH_NATIVE_FEATURES
kernel_nocflags = -DWITH_MMU_SUPPORT
endif

ifeq ($(kernel),hat030)
MINT = mint030h.prg
CPU = 030
KERNELDEFS = -DM68030 -DOLDTOSFS -DWITH_NATIVE_FEATURES
endif

# Example for a custom build:
# Add my1 to "kerneltargets" below
# Type in your shell "make my1"
Expand All @@ -138,5 +144,5 @@ endif
#
# all default targets
#
kerneltargets = 000 020 030 040 060 deb mil ara hat col
kerneltargets = 000 020 030 040 060 deb mil ara hat hat030 col
cputargets = 000 020 030 040 060 020-60 v4e
4 changes: 2 additions & 2 deletions sys/arch/SRCFILES
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
STARTUP = startup.o

COBJS = \
aranym.c \
check_exc.c \
halt.c \
info_mach.c \
Expand All @@ -14,21 +13,22 @@ COBJS = \
mprot000.c \
mprot030.c \
mprot040.c \
native_features.c \
process_reg.c \
psc0.c \
sig_mach.c \
timer.c

SOBJS = \
acia.S \
aranym_asm.S \
context.S \
cpu.S \
detect.S \
intr.S \
kernel.S \
mmu030.S \
mmu040.S \
native_features_asm.S \
pcibios.S \
pcibios_emu.S \
scsidrv_emu.S \
Expand Down
4 changes: 2 additions & 2 deletions sys/arch/halt.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# include "proc.h"
# include "filesys.h"

# include "aranym.h"
# include "native_features.h"

# ifdef __mcoldfire__

Expand Down Expand Up @@ -79,7 +79,7 @@ firebee_pic_write_byte(uchar b)
void
hw_poweroff(void)
{
# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES
nf_shutdown();
# else
/* CT60 poweroff */
Expand Down
6 changes: 3 additions & 3 deletions sys/arch/info_mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

# include "info_mach.h"
# include "arch/aranym.h"
# include "arch/native_features.h"
# include "global.h"
# include "mint/ktypes.h"

Expand Down Expand Up @@ -79,8 +79,8 @@ char *machine_str (void)
case machine_ct60:
str = "Atari Falcon/CT60";
break;
# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
case machine_aranym:
# ifdef WITH_NATIVE_FEATURES
case machine_emulator:
str = nf_name();
break;
# endif
Expand Down
35 changes: 17 additions & 18 deletions sys/arch/init_mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# include "arch/info_mach.h"
# include "arch/mprot.h"
# include "arch/tosbind.h"
# include "arch/aranym.h"
# include "arch/native_features.h"

# include "cookie.h"
# include "global.h"
Expand All @@ -58,9 +58,9 @@ enum special_hw
hades,
ct2,
ct60
# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES
,
aranym
emulator
# endif
};

Expand Down Expand Up @@ -171,18 +171,6 @@ _getmch (void)
break;
}

# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
case COOKIE_NF:
{
kernelinfo.nf_ops = nf_init();
kentry.vec_mch.nf_ops = nf_init();

if (kernelinfo.nf_ops)
add_info = aranym;
break;
}
# endif

#ifdef __mcoldfire__
case COOKIE__CPU:
{
Expand All @@ -202,6 +190,17 @@ _getmch (void)
jar++;
}
}

# ifdef WITH_NATIVE_FEATURES
/* unconditionally detect native features
* (the emulator / underlying OS doesn't have to provide a __NF cookie)
*/
kernelinfo.nf_ops = nf_init();
kentry.vec_mch.nf_ops = nf_init();

if (kernelinfo.nf_ops)
add_info = emulator;
# endif

/* own CPU test */
mcpu = detect_cpu();
Expand Down Expand Up @@ -364,9 +363,9 @@ identify (long mch, enum special_hw info)
case ct60:
machine = machine_ct60;
break;
# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
case aranym:
machine = machine_aranym;
# ifdef WITH_NATIVE_FEATURES
case emulator:
machine = machine_emulator;
break;
# endif
}
Expand Down
4 changes: 2 additions & 2 deletions sys/arch/aranym.c → sys/arch/native_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
*
*/

# include "aranym.h"
# include "native_features.h"


# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES

/* assembler routine */
int detect_native_features(void);
Expand Down
8 changes: 4 additions & 4 deletions sys/arch/aranym.h → sys/arch/native_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
* Aranym hardware support (experimental)
*/

# ifndef _m68k_aranym_h
# define _m68k_aranym_h
# ifndef _native_features_h
# define _native_features_h

# include "mint/mint.h"
# include "mint/arch/nf_ops.h"

# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES

struct nf_ops *nf_init(void);

Expand All @@ -49,4 +49,4 @@ void nf_shutdown(void);

# endif

# endif /* _m68k_aranym_h */
# endif /* _native_features_h */
2 changes: 1 addition & 1 deletion sys/arch/aranym_asm.S → sys/arch/native_features_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
*/

# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES

.text

Expand Down
2 changes: 1 addition & 1 deletion sys/bootmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static const char *debug_devices[] =

static const char *write_boot_levels[] =
{
# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES
"(none)",
"(File)",
"(File/Host-Console)"
Expand Down
6 changes: 3 additions & 3 deletions sys/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
# include "filesys.h"
# include "tty.h"
# include "proc.h"
# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# include "arch/aranym.h"
# ifdef WITH_NATIVE_FEATURES
# include "arch/native_features.h"
# endif

/*
Expand Down Expand Up @@ -188,7 +188,7 @@ sys_c_conws (const char *str)
while (*p++)
cnt++;

# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES
if( write_boot_file == 2 )
nf_debug(str);
# endif
Expand Down
4 changes: 2 additions & 2 deletions sys/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# include "libkern/libkern.h"

# include "arch/aranym.h"
# include "arch/native_features.h"
# include "arch/halt.h"
# include "arch/mprot.h"
# include "arch/syscall.h"
Expand Down Expand Up @@ -198,7 +198,7 @@ debug_ws(const char *s)
int scan;
int stopped;

# if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
# ifdef WITH_NATIVE_FEATURES
if (nf_debug(s))
return;
# endif
Expand Down
7 changes: 3 additions & 4 deletions sys/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
# include "arch/syscall.h" /* call_aes */
# include "arch/timer.h" /* delay_seconds() */
# include "arch/tosbind.h"
# include "arch/aranym.h"

# include "bios.h" /* */
# include "block_IO.h" /* init_block_IO */
Expand Down Expand Up @@ -617,9 +616,9 @@ init (void)
case machine_firebee:
mch_str = "firebee";
break;
#if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
/* only when really running on aranym */
case machine_aranym:
#ifdef WITH_NATIVE_FEATURES
case machine_emulator:
/* only when really running on aranym */
if (strcmp(machine_str(), "ARAnyM") == 0)
mch_str = "aranym";
break;
Expand Down
4 changes: 2 additions & 2 deletions sys/mint/ktypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ typedef enum
machine_ct2,
machine_ct60,
machine_firebee
#if defined(ARANYM) || defined(WITH_NATIVE_FEATURES)
#ifdef WITH_NATIVE_FEATURES
,
machine_aranym
machine_emulator
#endif
} machine_type;

Expand Down
4 changes: 2 additions & 2 deletions sys/xdd/nfcdrom/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ NFCDROM.XDD

It should serve as an example of how to use native features in FreeMiNT
device drivers and other modules. It requires the kernel to be build
with -DARANYM (common aranym aware FreeMiNT kernel builds) to actually
work.
with -DWITH_NATIVE_FEATURES (common aranym aware FreeMiNT kernel builds)
to actually work.

This implements a device /dev/nfcdrom to MiNT through which you can send
information to the ARAnyM cdrom driver.
Expand Down
4 changes: 2 additions & 2 deletions sys/xdd/nfstderr/README
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ NFSTDERR.XDD

It should serve as an example of how to use native features in FreeMiNT
device drivers and other modules. It requires the kernel to be build
with -DARANYM (common aranym aware FreeMiNT kernel builds) to actually
work.
with -DWITH_NATIVE_FEATURES (common aranym aware FreeMiNT kernel builds)
to actually work.

This implements a device /dev/nfstderr to MiNT through which you can send
information to the ARAnyM stderr output (the aranym console window).
Expand Down
Loading