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

Migrate sources and build scripts to Nestor80 #115

Merged
merged 34 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
69b6df4
Stop using 8080 mnemonics
Konamiman Nov 23, 2022
57886e5
Adjust bank1/msg.mac:
Konamiman Dec 4, 2022
f84f68d
Adapt the top level kernel source files for Nestor80
Konamiman Dec 4, 2022
4c0ffb5
Adjust source files in bank 0 and makefile for Nestor80
Konamiman Dec 5, 2022
2b7bfad
Adjust source files in bank 1 and makefile for Nestor80
Konamiman Dec 5, 2022
47fe6a4
Adjust source files in bank 2 and makefile for Nestor80
Konamiman Dec 5, 2022
35a3d6d
Adjust makefile for Nestor80 to use it for drv.mac and rel.mac
Konamiman Dec 5, 2022
4e4e545
Adjust source files in bank 3 and makefile for Nestor80
Konamiman Dec 5, 2022
887f8a7
Adjust source files in bank 4 and makefile for Nestor80
Konamiman Dec 5, 2022
a583183
Adjust source files in banks 5 and 6 and makefile for Nestor80
Konamiman Dec 5, 2022
b92ed92
Change makefile to generate all lower-case .rel files
Konamiman Dec 7, 2022
c18030c
Use N80 to assemble the old SunriseIDE driver
Konamiman Dec 7, 2022
ed27fdc
Use N80 to assemble the standalone kernels.
Konamiman Dec 7, 2022
81dd1ff
Adapt the new Sunrise IDE driver (originally assembled with sjasm)
Konamiman Dec 9, 2022
9b1e25e
Add the source code of the MegaFlashROM SCC+ SD, adapted to Nestor80
Konamiman Dec 10, 2022
1af9709
Adapt makefile to assemble the Flashjacks driver.
Konamiman Dec 10, 2022
66b0608
Fixes in the MegaFlashROM SD driver
Konamiman Dec 10, 2022
658ecba
Adapt NEXTOR.SYS source files and makefile for Nestor80.
Konamiman Dec 11, 2022
29f5212
Adapt the makefile of the command line tools to Nestor80
Konamiman Dec 12, 2022
177df90
Remove the macros for undocumented Z80 instructions
Konamiman Dec 12, 2022
dc8fd4b
Use the real N80 executable, remove remaining undoc instruction macros
Konamiman Dec 19, 2022
02126cf
Fix Sunrise IDE driver (change relative constants to modules)
Konamiman Jan 16, 2023
d8537e6
Use Linkstor80 instead of LINK-80 for linking.
Konamiman Mar 3, 2023
0d6a2b7
Link kernel files directly in BIN format
Konamiman Mar 3, 2023
eabf362
Use Libstor80 instead of LIB-80 for assembling the kernels
Konamiman Mar 13, 2023
98e0b7c
Build the kernels without LINK-80 compatibility mode
Konamiman Mar 14, 2023
4345e10
Build NEXTOR.SYS and the command line tools using Linkstor80
Konamiman Mar 14, 2023
1793eec
Change the names of unit descriptor fields to be more descriptive
Konamiman Mar 16, 2023
2de12b8
Change the name of more symbols in kvar.mac for readability
Konamiman Mar 16, 2023
1a8a721
Change the name of the rest of the descriptor related symbols in kvar…
Konamiman Mar 17, 2023
971470b
- Remove support for building in Windows.
Konamiman Mar 17, 2023
569da2b
Remove CPM32.EXE and M80/L80/LIB80.CPM
Konamiman Mar 17, 2023
8f0fbf3
Use the new register-based convention from SDCC 4.2 in all the C code.
Konamiman Mar 19, 2023
289b643
Adjust the GitHub CI job for Nestor80, Linkstor80 and Libstor80.
Konamiman Mar 20, 2023
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
40 changes: 29 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,37 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
sdcc binutils make curl cpm
- name: Install M80
sudo apt install -y binutils make curl cpm

curl -Lo sdcc.tar.bz2 https://sourceforge.net/projects/sdcc/files/sdcc-linux-amd64/4.2.0/sdcc-4.2.0-amd64-unknown-linux2.5.tar.bz2/download
mkdir sdcc
cd sdcc
tar xjf ../sdcc.tar.bz2
sudo cp -r sdcc-4.2.0/* /usr/local/
sdcc -v
- name: Install Nestor80
env:
VERSION: 1.1
N80_VERSION: '1.1'
LK80_VERSION: '1.0'
LB80_VERSION: '1.0'
run: |
curl -Lo m80.zip https://github.com/Konamiman/M80dotNet/releases/download/v${VERSION}/M80dotNet_${VERSION}_SelfContained_linux_x64.zip
unzip m80.zip
for NAME in M80 L80 LIB80; do
sudo install -v ${NAME} /usr/local/bin
rm ${NAME}
done
rm m80.zip
curl -Lo n80.zip https://github.com/Konamiman/Nestor80/releases/download/n80-v${N80_VERSION}/N80_${N80_VERSION}_SelfContained_linux-x64.zip
unzip n80.zip
sudo install -v N80 /usr/local/bin
rm N80
rm n80.zip

curl -Lo lk80.zip https://github.com/Konamiman/Nestor80/releases/download/lk80-v1.0/LK80_1.0_SelfContained_linux-x64.zip
unzip lk80.zip
sudo install -v LK80 /usr/local/bin
rm LK80
rm lk80.zip

curl -Lo lb80.zip https://github.com/Konamiman/Nestor80/releases/download/lb80-v${LB80_VERSION}/LB80_${LB80_VERSION}_SelfContained_linux-x64.zip
unzip lb80.zip
sudo install -v LB80 /usr/local/bin
rm LB80
rm lb80.zip
- name: Add buildtools
run: |
for NAME in buildtools/linux/*; do
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ source/kernel/bank*/*.inc
source/kernel/drivers/*.inc
source/kernel/drivers/**/*.inc
source/kernel/drivers/**/*.lst
!source/kernel/drivers/MegaFlashRomSD/*.bin
source/kernel/drivers/**/*.rom
source/kernel/drivers/**/*.ROM
source/kernel/bank5/*.dat
Expand All @@ -51,3 +50,5 @@ source/tools/data.mac
NEXTOR.SYS
NEXTORK.SYS
nextor_base.dat
*.LST

24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ Note that there is no `master` branch, but branches for each major version of Ne

## How to build Nextor

The "official" environment for building Nextor is Linux. Legacy support for Windows is still offered but it's deprecated. Read on for the ugly details.
Nextor requires Linux to be built. It should work on macOs too, but that hasn't been tested. If you are on Windows 10 or 11 you can use [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10).

### Linux

To build Nextor on Linux you'll need:
To build Nextor you'll need:

* `make`. On Debian/Ubuntu-ish systems you can just `apt-get install make`.
* The native MACRO80 tools provided by [the M80dotNet project](https://github.com/Konamiman/M80dotNet). Go to [the releases section](https://github.com/Konamiman/M80dotNet/releases) and download the appropriate variant of the latest version.
* [SDCC](http://sdcc.sourceforge.net/), for FDISK and the command line tools written in C. On Debian/Ubuntu-ish systems you can just `apt-get install sdcc`.
* [The Nestor80 tools](https://github.com/Konamiman/Nestor80). Go to [the releases section](https://github.com/Konamiman/Nestor80/releases) and download the appropriate variant of the latest version for the assembler (N80), the linker (LK80) and the library manager (LB80).
* [SDCC](http://sdcc.sourceforge.net/) **v4.2 or newer**, for FDISK and the command line tools written in C. On Debian/Ubuntu-ish systems you can just `apt-get install sdcc`.
* `objcopy` from [the binutils package](https://www.gnu.org/software/binutils/). On Debian/Ubuntu-ish systems you can just `apt-get install binutils`.
* `sjasm` v0.39 to assemble some of the drivers. You have it in the `buildtools/Linux` folder, but you can also build it from [the sources](https://github.com/Konamiman/Sjasm/tree/v0.39) (remember to switch to the `v0.39` branch).
* `mknexrom` to generate the ROM files with the drivers. You have it in the `buildtools/Linux` folder, but you can also build it from the source in the `buildtools/sources` directory.

Except for those obtained via `apt`, you'll need to place these tools at a suitable location to be able to use them, e.g. `/usr/bin`.
Expand All @@ -49,16 +46,3 @@ There are five makefiles that will take care of building the different component

You may want to take a look at [this now closed pull request from Dean Netherton](https://github.com/Konamiman/Nextor/pull/79) that contains a different attempt at writing makefiles for bulding Nextor. It even has some nice extra features like building FDD and HDD images with Nextor, and building the `mknexrom` tool itself.

## Windows

If you use Windows 10 the recommended approach is to use the Linux tools and scripts with [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10). If you use an older Windows the recommended approach is to upgrade to Windows 10 (or to install Linux in a separate partition or disk, or in a virtual machine).

However, if for some reason you are still using a non-WSL capable Windows, support for building Nextor is available as well; but note that it will probably be removed at some point in the future, as it's a maintenance burden (seriously, give Windows 10 and WSL a try, it's really worth it).

To build Nextor on Windows you need:

* The tools in the `buildtools/Windows` folder. These must be placed in some folder included in the `PATH` environment variable.
* [SDCC](http://sdcc.sourceforge.net/), for FDISK and the command line tools written in C.
* .NET Framework 2.0 or higher, for the `SymToEqus` tool.

You'll find a number of `.bat` files available at the same locations of the Linux makefiles except for the one in `source` (see "Linux" section above). These are not "makefile-ish" and always build the whole set of kernels/tools.
Binary file removed buildtools/linux/sjasm
Binary file not shown.
82 changes: 0 additions & 82 deletions buildtools/sources/SymToEqus.cs

This file was deleted.

Binary file removed buildtools/windows/CPM32.EXE
Binary file not shown.
Binary file removed buildtools/windows/HEX2BIN.EXE
Binary file not shown.
Binary file removed buildtools/windows/SymToEqus.exe
Binary file not shown.
Binary file removed buildtools/windows/dd.exe
Binary file not shown.
Binary file removed buildtools/windows/mknexrom.exe
Binary file not shown.
Binary file removed buildtools/windows/sjasm.exe
Binary file not shown.
8 changes: 4 additions & 4 deletions source/command/chkdsk/const.inc
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ CF_TE EQU 4 ;Set => filename terminator
;
DR_FILE equ 0 ;Filename
DR_EXT equ 8 ;Filename extension
DR_ATTR equ 11 ;Attributes byte
DR_DCHAR equ 12 ;Deleted filename character
DR_TIME equ 22 ;Time of last update
DR_ATTRIBUTES equ 11 ;Attributes byte
DR_DELETED_FIRST_CHAR equ 12 ;Deleted filename character
DR_UPDATED_TIME equ 22 ;Time of last update
DR_DATE equ 24 ;Date of last update
DR_CLU equ 26 ;Fisrt cluster number
DR_FIRST_CLUSTER equ 26 ;Fisrt cluster number
DR_SIZE equ 28 ;File size
;
;
10 changes: 5 additions & 5 deletions source/command/chkdsk/dir.mac
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ memory_ok: ld hl,(DIR_START##) ;Remember start cluster for
pop hl ;Record start cluster of
ld (DIR_PARENT##),hl ; sub-directories parent
;
ld l,(ix+DR_CLU)
ld h,(ix+DR_CLU+1) ;Setup DIR_START ready to
ld l,(ix+DR_FIRST_CLUSTER)
ld h,(ix+DR_FIRST_CLUSTER+1) ;Setup DIR_START ready to
ld (DIR_START##),hl ; search this sub-directory.
;
ld hl,(FILE_PTR##) ;Store the address of this
Expand Down Expand Up @@ -389,13 +389,13 @@ flst_new_2: ld hl,ER_FLAGS## ;If file list is not being
ld (RAM_TOP##),hl ;Record new top of RAM and
ld (FILE_PTR##),hl ; pointer to this record.
;
use_dummy_rec: ld a,(ix+DR_ATTR) ;Store attributes byte in
use_dummy_rec: ld a,(ix+DR_ATTRIBUTES) ;Store attributes byte in
ld (hl),a ; the file record.
inc hl
ld a,(ix+DR_CLU)
ld a,(ix+DR_FIRST_CLUSTER)
ld (hl),a ;Store this entry's cluster
inc hl ; number in the file record.
ld a,(ix+DR_CLU+1)
ld a,(ix+DR_FIRST_CLUSTER+1)
ld (hl),a
inc hl
;
Expand Down
22 changes: 11 additions & 11 deletions source/command/chkdsk/main.mac
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ scan_dir_entry: push hl ;Point IX at directory entry
cp 0E5h
jr nz,not_deleted ;If entry is deleted then
xor a ; remove the saved first
cp (ix+DR_DCHAR) ; character so it can't be
ld (ix+DR_DCHAR),a ; un-deleted and mark buffer
cp (ix+DR_DELETED_FIRST_CHAR) ; character so it can't be
ld (ix+DR_DELETED_FIRST_CHAR),a ; un-deleted and mark buffer
call nz,DIRTY_BUFFER## ; as dirty if it was non-zero.
jr scan_dir_next
;
Expand All @@ -364,7 +364,7 @@ scan_dir_entry: push hl ;Point IX at directory entry
not_deleted: call FLST_NEW## ;Create a new record for this
call ENT_DEBUG## ; entry in the file list.
;
ld a,(ix+DR_ATTR) ;Test volume-name bit and
ld a,(ix+DR_ATTRIBUTES) ;Test volume-name bit and
bit AT_VOL,a ; skip if not set.
jr z,not_vol_name
;
Expand All @@ -389,7 +389,7 @@ kill_vol_name: call QER_MSG## ;Give error message
;
not_vol_name: call CHECK_CHAIN ;Check that chain is valid
ex af,af' ;Save file size check flag
bit AT_DIR,(ix+DR_ATTR) ;If entry is a file then skip
bit AT_DIR,(ix+DR_ATTRIBUTES) ;If entry is a file then skip
jr z,not_sub_dir ; to file size checking.
;
call DRE_SV## ;Setup for sub-dir search
Expand All @@ -401,7 +401,7 @@ not_vol_name: call CHECK_CHAIN ;Check that chain is valid
call DRE_SAME## ; back to its parent.
ld a,__CVD_MSG## ;Print out an error message.
call QER_MSG##
ld (ix+DR_ATTR),ATM_ARC ;Convert the directory into
ld (ix+DR_ATTRIBUTES),ATM_ARC ;Convert the directory into
call DIRTY_BUFFER## ; a file, both in the sector
ld hl,(FILE_PTR##) ; buffer and in the file
ld (hl),ATM_ARC ; list record.
Expand Down Expand Up @@ -440,8 +440,8 @@ CHECK_CHAIN:
ld bc,0 ;Start cluster count
exx ; at zero.
;
ld e,(ix+DR_CLU) ;Get first cluster from
ld d,(ix+DR_CLU+1) ; directory entry and if
ld e,(ix+DR_FIRST_CLUSTER) ;Get first cluster from
ld d,(ix+DR_FIRST_CLUSTER+1) ; directory entry and if
ld a,d ; it is zero then return
or e ; immediately with BC=0
jr z,chain_done_z ; to indicate null chain.
Expand Down Expand Up @@ -481,8 +481,8 @@ invalid_first: ld hl,(FILE_PTR##) ;First cluster number is
ld (hl),0 ; number both in the file
inc hl ; list record and also in the
ld (hl),0 ; directory entry itself.
ld (ix+DR_CLU),0
ld (ix+DR_CLU+1),0 ;Flag sector as dirty to
ld (ix+DR_FIRST_CLUSTER),0
ld (ix+DR_FIRST_CLUSTER+1),0 ;Flag sector as dirty to
call DIRTY_BUFFER## ; ensure it gets written out
ld a,__IENT_MSG##
call QER_MSG## ;Print an error message.
Expand All @@ -508,7 +508,7 @@ endif
chain_done_z: xor a ;Allow file size check.
chain_done: push af ;Save file size check flag
exx
ld a,(ix+DR_ATTR)
ld a,(ix+DR_ATTRIBUTES)
ld hl,DIR_COUNT## ;Point HL at correct count
bit AT_DIR,a ; variable for this directory
jr nz,got_count_addr ; entry. There are seperate
Expand Down Expand Up @@ -662,7 +662,7 @@ dot_fail_nz_1: pop bc ; failure.
ld bc,0 ; this is what should be in
not_root_clu: ; the entry.
;
ld de,DR_CLU-DR_ATTR ;Get cluster number from
ld de,DR_FIRST_CLUSTER-DR_ATTRIBUTES ;Get cluster number from
add hl,de ; directory entry and compare
ld e,(hl) ; it with the one passed in BC.
inc hl
Expand Down
2 changes: 1 addition & 1 deletion source/command/command/cli.mac
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ if 1
CALL _BDOS ; we can proceed.
RET NZ ; Report any errors.

LD A,(BUFF##+20) ; We had better define "FIB_ID".
LD A,(BUFF##+20) ; We had better define "FIB_VOLUME_ID".
BIT 7,A ; This is not actuall a
LD A,.BADVER## ; "Wrong DOS version" what the error
RET NZ ; code was intended for.
Expand Down
Binary file removed source/command/msxdos/CPM32.EXE
Binary file not shown.
Binary file removed source/command/msxdos/L80.CPM
Binary file not shown.
Binary file removed source/command/msxdos/LIB80.CPM
Binary file not shown.
Binary file removed source/command/msxdos/M80.CPM
Binary file not shown.
Loading