Skip to content

Commit

Permalink
v2.1 beta 2
Browse files Browse the repository at this point in the history
- Nextor will now try to load MSXDOS2.SYS if NEXTOR.SYS is not found in the boot drive.

- The method for selecting partitions for automatic mapping has changed from requiring a NEXTOR.DAT file in the root directory to having the "active" flag set in the partition table.

- Now the first 9 partitions of a device will be scanned during the automatic mapping procedure, this includes extended partitions.

- FDISK allows to change the "active" flag of new and existing partitions.

- FDISK now always creates extended partitions, even if 4 or less partitions are defined.

- FDISK now creates FAT16 partitions with a partition type code of 14 (FAT16 LBA) instead of 6 (FAT16 CHS).

- The numeric keyboard can now be used both when booting and when changing disks in disk emulation mode.

- Russian keyboard is now properly recognized (numeric keys only).

- Introduced the boot key inverters.

- Introduced the one-time boot keys.

- Introduced the NEXBOOT.COM tool to set the RAM based one-time boot keys.

- Introduced the RAM based one-time disk emulation mode.

- The method to enter the old disk emulation mode (now named "persistent") has changed from requiring a NEXT_DSK.DAT file in the root directory to storing a pointer to the emulation data file in the partition table of the device.

- Pressing the 0 key at boot time will delete the pointer to the emulation data file in the partition table, thus permanently disabling the emulation mode - no need to manually do anything else.

- When Nextor is waiting for a disk key press after having pressed GRAPH in disk emulation mode, now you can press GRAPH again to cancel the disk change.

- The first Nextor kernel to boot now clears the screen before invoking the driver initialization.

- ARG is no longer used as temporary work area by the Nextor kernel, this should improve the compatibility of games in disk emulation mode.

- Fix: drive was remapped in case of error (even if it was retried successfully).

- Fix: boot sector checksum calculation had a bug that caused "Wrong disk" errors.

- Fix: #1 pressing CTRL+STOP while Nextor was trying to load NEXTOR.SYS hanged the computer.

- Fix: #23 computer hanged when booting with one single drive letter (e.g. when using single-device controller in a computer without internal disk drive).

- Fix: #29 wrong stack management hangedd the computer when a file handle was read or written to a number of times.

- Fix: computer crashing when more than one Nextor kernel was present as soon as the extended BIOS hook was called (for example, when loading COMMAND2.COM).

- BREAKING CHANGE: The address of CODE_ADD, used by the CALLB0 routine, has changed to F1D0h (it was F84Ch).

- Fix: there was Nextor kernel code in the 1K free area in pages 0 and 3, so putting anything here caused problems, e.g. DOS 1 mode didn't work.

- _GPART now returns the status byte of the partition, and allows to retrieve the device sector number that holds the partition table entry instead of information about the partition.
  • Loading branch information
Konamiman committed Apr 26, 2019
1 parent f510e43 commit 6ecd074
Show file tree
Hide file tree
Showing 76 changed files with 7,158 additions and 3,811 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
syntax: glob

.vs/
.vscode/
bin/**
*.sym
*.SYM
Expand Down
4 changes: 2 additions & 2 deletions docs/DRIVER.ASM
@@ -1,4 +1,4 @@
; Dummy disk driver for Nextor 2.0
; Dummy disk driver for Nextor 2.1
; By Konamiman, 8/2018
;
; This code can be used as the basis for developing
Expand All @@ -21,7 +21,7 @@ DRV_START:
;This is a 2 byte buffer to store the address of code to be executed.
;It is used by some of the kernel page 0 routines.

CODE_ADD: equ 0F84Ch
CODE_ADD: equ 0F1D0h


;-----------------------------------------------------------------------------
Expand Down
18 changes: 13 additions & 5 deletions docs/Nextor 2.1 Driver Development Guide.md
Expand Up @@ -102,7 +102,9 @@

[5. Change history](#5-change-history)

[5.1. v2.1.0 beta 1](#51-v210-beta-1)
[5.1. v2.1.0 beta 2](#51-v210-beta-2)

[5.2. v2.1.0 beta 1](#52-v210-beta-1)


## 1. Introduction
Expand Down Expand Up @@ -428,7 +430,7 @@ Input: Address of code to invoke in (CODE_ADD).
Output: AF, BC, DE, HL, IX, IY returned from the called routine.
```

Note: the address of CODE_ADD is F84Ch.
Note: the address of CODE_ADD is F1D0h.

#### 4.2.4. CALBNK (4042h)

Expand Down Expand Up @@ -611,13 +613,13 @@ Please note also the following:

#### 4.4.4. DRV_BASSTAT (4139h)

This is the entry for the BASIC extended statements ("CALLs") handler. It works the same way as the standard handlers (see _MSX2 Technical Handbook_, chapter 2, for details), except that if the handled statements have parameters, the MSX BIOS routine CALBAS (needed to invoke the MSX BASIC interpreter helper routines) can't be used directly; instead, it must be invoked via the CALLB0 entry in kernel page 0.
This is the entry for the BASIC extended statements ("CALLs") handler. It works the same way as the standard handlers (see [MSX2 Technical Handbook, chapter 2](https://github.com/Konamiman/MSX2-Technical-Handbook/blob/master/md/Chapter2.md), for details), except that if the handled statements have parameters, the MSX BIOS routine CALBAS (needed to invoke the MSX BASIC interpreter helper routines) can't be used directly; instead, it must be invoked via [the CALLB0 entry](#423-callb0-403fh) in kernel page 0.

If the driver does not handle BASIC extended statements, it must simply set the carry flag and return.

#### 4.4.5. DRV_BASDEV (413Ch)

This is the entry for the BASIC extended devices handler. It works the same way as the standard handlers (see _MSX2 Technical Handbook_, chapter 2, for details), but see the note on DRV_BASSTAT about CALBAS.
This is the entry for the BASIC extended devices handler. It works the same way as the standard handlers (see [MSX2 Technical Handbook, chapter 2](https://github.com/Konamiman/MSX2-Technical-Handbook/blob/master/md/Chapter2.md), for details), but see the note about CALBAS on [DRV_BASSTAT](#444-drv_basstat-4139h).

If the driver does not handle BASIC extended devices, it must simply set the carry flag and return.

Expand Down Expand Up @@ -1018,6 +1020,12 @@ This section contains the change history for the different versions of Nextor. O

This list contains the changes for the 2.1 branch only. For the change history of the 2.0 branch see the _[Nextor 2.0 Driver Development Guide](../../../blob/v2.0/docs/Nextor%202.0%20Driver%20Development%20Guide.md#5-change-history)_ document.

### 5.1. v2.1 beta 1
### 5.1. v2.1.0 beta 2

- **BREAKING CHANGE:** The address of CODE_ADD, used by [the CALLB0 routine](#423-callb0-403fh), has changed to F1D0h (it was F84Ch).

- Fix: there was Nextor kernel code in the 1K free area in pages 0 and 3, so putting anything here caused problems, e.g. DOS 1 mode didn't work.

### 5.2. v2.1.0 beta 1

Added the "User is requesting reduced drive count" flag to the input of [the DRV_INIT routine](#443-drv_init-4136h) and [the DRV_CONFIG routine](#448-drv_config-4151h).
106 changes: 62 additions & 44 deletions docs/Nextor 2.1 Getting Started Guide.md

Large diffs are not rendered by default.

150 changes: 133 additions & 17 deletions docs/Nextor 2.1 Programmers Reference.md

Large diffs are not rendered by default.

211 changes: 174 additions & 37 deletions docs/Nextor 2.1 User Manual.md

Large diffs are not rendered by default.

Binary file modified docs/img/gsg/DirAAndDirB.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirAAndDirBDos1Mode.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirAAndDirBDos1ModeWithNextorDat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirAAndDirBWithFiles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirInDos1Mode.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirInDos1ModeWithNextorDat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirTwoSystemFiles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DirWithNextorDat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DriversOneController.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DriversOneDrive.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DriversTwoDrives.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/DrvinfoInBasic.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/FourPartitionsList.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/gsg/NextorPrompt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/gsg/Partitions2And4Active.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/gsg/Partitions2And4Active.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions source/kernel/bank0/betainfo.mac
Expand Up @@ -9,3 +9,7 @@ endif
if RC gt 0
defb " RC ",RC+"0"," "
endif

if RR gt 0
defb "r",RR+"0"," "
endif
62 changes: 36 additions & 26 deletions source/kernel/bank0/dosboot.mac
Expand Up @@ -142,11 +142,8 @@ READ_BOOT_SEC::
; Corrupts: AF,BC,DE,HL
;
;
ld hl,BOOT_DISKVECT ;Setup disk error and break
ld (DISKVECT##),hl ; vector for trapping
ld hl,BOOT_BREAKVECT ; errors while booting.
ld (BREAKVECT##),hl
;
call SET_BOOT_VECTORS

ld de,($SECBUF##) ;Set the DTA address ready
ld c,_SETDTA## ; for reading the boot
call BOOT_BDOS ; sector in.
Expand Down Expand Up @@ -283,24 +280,8 @@ TRY_MSX_DOS::
;
ld (CUR_DRV##),a ;Setup default drive.

;push af
;ld a,(NOTFIRST##)
;or a
;jr nz,NOBOOT
;ld e,a
;ld a,1
;ld bc,0FF00h + _LOCK##
;call BOOT_BDOS
;ld hl,MFLAGS##
;set 1,(hl)

NOBOOT:
;pop af

ld hl,BOOT_DISKVECT ;Setup disk error and break
ld (DISKVECT##),hl ; vector for trapping
ld hl,BOOT_BREAKVECT ; errors while booting.
ld (BREAKVECT##),hl
call SET_BOOT_VECTORS
;
ld b,0 ;Unassign all drives (does
ld d,b ; not waste very much time)
Expand All @@ -313,13 +294,19 @@ NOBOOT:
jr z,msxdos_fail
;
retry_dos:
ld de,BOOT_NAME ;Try to open the "MSXDOS.SYS"
xor a ; file on the default drive.
ld de,BOOT_NAME ;Try to open the "NEXTOR.SYS"
xor a ;file on the default drive.
ld c,_OPEN##
call BOOT_BDOS
jr z,msxdos_bootok

ld de,OLD_BOOT_NAME ;Fallback to try "MSXDOS.SYS"
xor a
ld c,_OPEN##
call BOOT_BDOS
jr nz,msxdos_fail ;Jump if file not found
;

msxdos_bootok:
ld de,100h
ld hl,3F00h ;Try to read the file in at
ld c,_READ## ; 100h up to the top of
Expand Down Expand Up @@ -352,10 +339,33 @@ msxdos_fail:
;
;
BOOT_NAME: db "\NEXTOR.SYS",0
;
OLD_BOOT_NAME: db "\MSXDOS2.SYS",0
;
;-----------------------------------------------------------------------------
;

; Originally, the abort vector was set pointing to BOOT_BREAKVECT whenever
; NEXTOR.SYS was about to be loaded. If the user pressed CTRL+STOP at this time,
; the abort routine kicked in and it tried to read the address at BOOT_BREAK
; and execute it - but since the user paging had been restored before that,
; a random value was being read instead, and thus random code was executed
; and the computer crashed.
;
; Solution: since this default abort routine is just one byte (a RET),
; just store it at an unused place in page 3 and point to it instead.

SBDAVEC::
SET_BOOT_VECTORS:
ld hl,BOOT_DISKVECT
ld (DISKVECT##),hl
ld a,0C9h
ld (RAM_ABORT##),a
ld hl,RAM_ABORT##
ld (RAM_ABORT##+1),hl
ld hl,RAM_ABORT##+1
ld (BREAKVECT##),hl
ret

BOOT_BDOS: call BDOS## ;Routine for calling BDOS.
cp .ABORT##
jr nz,not_abort_err ;If we have an aborted disk
Expand Down

0 comments on commit 6ecd074

Please sign in to comment.