Skip to content

Commit ab66c7d

Browse files
authored
v2.1.0: post-RC1 fixes (#61)
- Fix: broken RAM disk (introduced in RC1). - Fix: disk errors for old MSX-DOS 1 file functions in BASIC crash the computer (#59). - Add: new flag returned by LUN_INFO allows to instruct Nextor to ignore devices when searching devices for automatic device to drive mapping (#54). - Fix: files can't have 3 or 4 in their names in DOS 1 mode (#55). - Fix: after booting directly yo BASIC by pressing 3, CALL SYSTEM doesn't work. - Fix: slot disable keys don't work on real MSX computers (#49). - Add: new boot key, pressing N at boot time disables all the Nextor kernels present. - Add: default DPB gets a fixed address of 7BAAh in banks 0 and 3, so it can be customized reliably. - Add: PROMPT routine made available to drivers at address 41E8h (#42). - Fix: the DOS 1 variables "data buffer changed" and "redirect console output to printer" were not zeroed when switching to DOS 1 mode at boot time. - Fix: can't change volume name when there are long filename entries in the root directory (#57). - Fix: absolute sector read/write functions not working properly when a file is mounted to a drive (#43). - Fix: bad sector buffer management when writing to a mounted file causing data corruption on the mounted file (#58). - Fix: drive parameters not updated on first access to a drive after a media change if the driver provides drive mapping via DRV_CONFIG, causing bad data read (#45).
1 parent 80c5908 commit ab66c7d

26 files changed

+23819
-23573
lines changed

Diff for: docs/DRIVER.ASM

+2
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ DEV_STATUS:
663663
; be write protected or write enabled is not considered
664664
; to be read-only.
665665
; bit 2: 1 if the LUN is a floppy disk drive.
666+
; bit 3: 1 if this LUN shouldn't be used for automapping.
667+
; bits 4-7: must be zero.
666668
;+8 (2): Number of cylinders
667669
;+10 (1): Number of heads
668670
;+11 (1): Number of sectors per track

Diff for: docs/Nextor 2.1 Driver Development Guide.md

+36-6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242

4343
[4.2.8. CHGBNK (7FD0h)](#428-chgbnk-7fd0h)
4444

45+
[4.2.9 PROMPT (41E8h)](#429-prompt-41e8h)
46+
4547
[4.3. The driver header](#43-the-driver-header)
4648

4749
[4.3.1. DRV_SIGN (4100h)](#431-drv_sign-4100h)
@@ -102,9 +104,11 @@
102104

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

105-
[5.1. v2.1.0 beta 2](#51-v210-beta-2)
107+
[5.1. v2.1.0 final](#51-v210-final)
108+
109+
[5.2. v2.1.0 beta 2](#52-v210-beta-2)
106110

107-
[5.2. v2.1.0 beta 1](#52-v210-beta-1)
111+
[5.3. v2.1.0 beta 1](#53-v210-beta-1)
108112

109113

110114
## 1. Introduction
@@ -490,6 +494,25 @@ Output: -
490494
Corrupts: AF
491495
```
492496

497+
#### 4.2.9 PROMPT (41E8h)
498+
499+
Starting with Nextor kernel 2.1.0 you can call the PROMPT routine to display a "Insert disk for drive X: and strike a key when ready" message and wait for the user to press a key. This routine is available at address 41E8h in the main bank, and you can invoke it using [CALLB0](#423-callb0-403fh) as follows:
500+
501+
```
502+
PROMPT: equ 41E8h
503+
CODE_ADD: equ 0F1D0h
504+
CALLB0: equ 403Fh
505+
506+
ld hl,PROMPT
507+
ld (CODE_ADD),hl
508+
call CALLB0
509+
```
510+
511+
The following work area is used by this routine:
512+
513+
* The zero-based drive number is taken from TARGET, at address F33Fh.
514+
* The H.PROMPT hook at address F24Fh is called with the zero-based drive number in A before the routine is executed.
515+
493516
### 4.3. The driver header
494517

495518
The driver header is the first part of a Nextor driver. It contains some information that helps Nextor to identify the driver and determine its type.
@@ -613,7 +636,7 @@ Please note also the following:
613636
614637
#### 4.4.4. DRV_BASSTAT (4139h)
615638
616-
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.
639+
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, "Expansion of CMD command"](https://github.com/Konamiman/MSX2-Technical-Handbook/blob/master/md/Chapter2.md), and [MSX2 Technical Handbook, chapter 5, "Developing Cartridge Software"](https://github.com/Konamiman/MSX2-Technical-Handbook/blob/master/md/Chapter5.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.
617640
618641
If the driver does not handle BASIC extended statements, it must simply set the carry flag and return.
619642
@@ -977,7 +1000,8 @@ The information to be returned is a 12 byte block with the following structure:
9771000
bit 0: 1 if the medium is removable
9781001
bit 1: 1 if the medium is read only
9791002
bit 2: 1 if the logical unit is a floppy disk drive
980-
bits 3-7: Unused, must be zero
1003+
bit 3: 1 if the logical unit should not be used for automapping
1004+
bits 4-7: Unused, must be zero
9811005
+8 (2): Number of cylinders
9821006
+10 (1): Number of heads
9831007
+11 (1): Number of sectors per track
@@ -1020,12 +1044,18 @@ This section contains the change history for the different versions of Nextor. O
10201044
10211045
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.
10221046
1023-
### 5.1. v2.1.0 beta 2
1047+
### 5.1. v2.1.0 final
1048+
1049+
- [LUN_INFO](#464-lun_info-4169h) can now return a flag indicating that the device/LUN should not be used for automapping.
1050+
1051+
- Added the [PROMPT](#429-prompt-41e8h) routine.
1052+
1053+
### 5.2. v2.1.0 beta 2
10241054
10251055
- **BREAKING CHANGE:** The address of CODE_ADD, used by [the CALLB0 routine](#423-callb0-403fh), has changed to F1D0h (it was F84Ch).
10261056
10271057
- 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.
10281058
1029-
### 5.2. v2.1.0 beta 1
1059+
### 5.3. v2.1.0 beta 1
10301060
10311061
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).

Diff for: docs/Nextor 2.1 User Manual.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ The boot time configuration of Nextor can be modified by keeping pressed some sp
265265

266266
* **SHIFT**: Prevent MSX-DOS kernels from booting, but allow Nextor kernels to boot normally. This is useful to disable the internal floppy disk drive in order to get some extra TPA memory, especially in MSX-DOS 1 mode.
267267

268-
* **slot key**: Prevent the Nextor kernel associated to the specified slot key from booting. This is useful when the kernel ROM must be updated so you need to disable it. The associated keys for each slot are:
268+
* **N**: Prevent any Nextor kernel present from booting. This is useful when the kernel ROM must be updated from an storage device controlled by a non-Nextor controller (e.g. the internal floppy disk drive).
269+
270+
* **slot key**: Prevent the Nextor kernel associated to the specified slot key from booting. This is useful when the kernel ROM must be updated from a device controlled by another Nextor controller. The associated keys for each slot are:
269271

270272
* Q for primary slot 1
271273
* A for primary slot 2
@@ -402,9 +404,10 @@ The internal disk drive would not have any drives attached if you pressed SHIFT
402404

403405
After all drives have been assigned to drivers, a device and partition to drive automatic mapping procedure will be run for each of these drives. Each drive is mapped to the first partition found that meets the following conditions:
404406

405-
1. Is a valid FAT12 or FAT16 partition (only FAT12 when booting in MSX-DOS 1 mode)
406-
2. Has the "active" flag set in the partition table (this can be set using [FDISK](#35-the-built-in-partitioning-tool))
407-
3. No drives have been already mapped to partitions in the same device
407+
1. The device doesn't have the "don't use for automapping" flag set (this flag is set by the driver)
408+
2. Is a valid FAT12 or FAT16 partition (only FAT12 when booting in MSX-DOS 1 mode)
409+
3. Has the "active" flag set in the partition table (this can be set using [FDISK](#35-the-built-in-partitioning-tool))
410+
4. No drives have been already mapped to partitions in the same device
408411

409412
If no partitions are found that meet all three conditions, then the search is started over, but this time skipping the "active" flag check. If this fails again, absolute sector 0 of the device is checked (to see if the device doesn't have partitions but holds a valid FAT filesystem) as a last resort before leaving the drive unmapped.
410413

@@ -648,11 +651,13 @@ Note: do not use this tool with NEXTOR.SYS versions older than 2.0 beta 2.
648651
The NEXBOOT.COM tool allows to easily configure the keys to be used as [one-time boot keys](#292-one-time-boot-keys) in the next reset. The syntax is:
649652

650653
```
651-
NEXBOOT <boot keys>|. [<slot> [<slot>... ]]
654+
NEXBOOT <boot keys>|. [*|<slot> [<slot>... ]]
652655
```
653656

654657
where the boot keys are the numeric keys, C for CTRL and S for shift, and `<slot>` are the slot numbers of the Nextor kernels to be disabled. For example `NEXBOOT 1C` will invert CTRL and 1 keys, `NEXBOOT S 1 23` will invert the SHIFT keys and disable the Nextor kernels in slots 1 and 2-3, and `NEXBOOT . 2` will just disable the Nextor kernel in slot 2.
655658

659+
When using version 1.1 or newer of NEXBOOT.COM you can also specify `*` to disable all the Nextor kernels, this is equivalent to pressing `N` while booting. Note however that this will only with Nextor kernels whose version is 2.1 or newer.
660+
656661
In all cases, the tool resets the computer immediately after apporpriately setting the keys information in RAM.
657662

658663
#### 3.4.12. EMUFILE: the disk emulation mode tool

Diff for: source/kernel/bank0/bdos.mac

+15-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ endif
5252
;-----------------------------------------------------------------------------
5353
;
5454
KAB_ROUTINE:
55+
KABR::
5556
;
5657
; This is the KBDOS abort routine which is set up whenever the 0F37Dh BDOS
5758
; entry is active. It is set up by the "KB_INIT" routine above and will
@@ -60,6 +61,9 @@ KAB_ROUTINE:
6061
; the first BDOS call, switches back to the user's stack and jumps to the
6162
; user's defined "BREAKVECT" routine.
6263
;
64+
; The hook at KAB_VECT is set to an intermediate hook KABJ instead of pointing
65+
; directly here, see KABJ at the end of drv.mac for an explanation of why.
66+
;
6367
;
6468
exx ;Save error code in B'
6569
ld b,a ; just for fun to BUFOUT.
@@ -73,6 +77,7 @@ KAB_ROUTINE:
7377
;-----------------------------------------------------------------------------
7478
;
7579
KDSK_ROUTINE:
80+
KDERR::
7681
;
7782
; This is the KBDOS disk error routine which is set up whenever the 0F37Dh
7883
; BDOS entry is active. It is set up by the "KB_INIT" routine above and will
@@ -82,6 +87,9 @@ KDSK_ROUTINE:
8287
; routine returns then the KBDOS paging is re-enabled and control returned to
8388
; the KBDOS.
8489
;
90+
; The hook at KDSK_VECT is set to an intermediate hook KDERJ instead of pointing
91+
; directly here, see KDERJ at the end of drv.mac for an explanation of why.
92+
;
8593
; Entry: A' = Old error code (passed to DISKVECT in C)
8694
; A = New error code (passed to DISKVECT in A')
8795
; B = Drive number (decremented & passed to DISKVECT in A)
@@ -195,9 +203,14 @@ if 1
195203
; Insure error vectors are directed to us. Just for bad mannered applications
196204
; that call 0005h at one time and F37Dh at another time. ...HF...
197205
;
198-
ld hl,KAB_ROUTINE ;Setup the disk vector and
206+
; Note: KABJ and KDERJ need to be defined at the same address as defined at drv.mac
207+
208+
KABJ equ 7BC0h
209+
KDERJ equ KABJ+7
210+
211+
ld hl,KABJ ; ;Setup the disk vector and
199212
ld (KAB_VECT##),hl ; abort vector routines for
200-
ld hl,KDSK_ROUTINE ; MSX-DOS 1.0 compatability.
213+
ld hl,KDERJ ; ; MSX-DOS 1.0 compatability.
201214
ld (KDSK_VECT##),hl ;
202215
endif
203216
LD HL,(BDOS_STACK##)

Diff for: source/kernel/bank0/dskab.mac

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.z80
2+
3+
INCLUDE MACROS.INC
4+
INCLUDE CONST.INC
5+
6+
;org 7FC0h
7+
8+
nop
9+
nop
10+
nop
11+
nop
12+
jp KABR##
13+
14+
nop
15+
nop
16+
nop
17+
nop
18+
jp KDSKR##
19+
20+
finish <DSKAB>
21+
end

0 commit comments

Comments
 (0)