Skip to content

Commit 3a1e520

Browse files
authored
Merge pull request #136 from Konamiman/v2.1.2
2 parents 181d3e0 + bdbdcba commit 3a1e520

File tree

17 files changed

+594
-133
lines changed

17 files changed

+594
-133
lines changed

docs/Nextor 2.1 Getting Started Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This section explains the steps needed to setup blueMSX in order to follow this
4141

4242
a. Download the following files from [the lastest release of Nextor in GitHub](https://github.com/Konamiman/Nextor/releases/latest):
4343

44-
* Nextor kernel with Sunrise IDE driver. Please choose the file with _.SunriseIDE.emulators.ROM_ extension (the _.SunriseIDE.ROM_ version works but only recgonizes the slave IDE device in emulators).
44+
* Nextor kernel with Sunrise IDE driver. Please choose the file with _.SunriseIDE.blueMSX.ROM_ extension (the _.SunriseIDE.ROM_ version works but only recognizes the slave IDE device in blueMSX), if you are using another emulator or a physical Sunrise IDE (or compatible) controller hardware you can use the file with _.SunriseIDE.ROM_ extension instead.
4545

4646
* Nextor tools disk image (_tools.dsk.zip_).
4747

docs/Nextor 2.1 Programmers Reference.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,14 @@ The partition type code returns information about the filesystem that the partit
501501
0: None (the partition with the specified number does not exist)
502502
1: FAT12
503503
4: FAT16, smaller than 32MB (obsolete)
504-
5: Extended (see below)
504+
5: Extended (CHS) (see below)
505505
6: FAT16 (CHS)
506506
14: FAT16 (LBA)
507+
15: Extended (LBA)
507508
```
508509

510+
**Note:** Prior to version 2.1.2, Nextor would only recognize a partition as extended if it had the partition type code 5 (extended CHS), and FDISK would use this code when creating extended partitions. Starting with Nextor 2.1.2, FDISK will use partition type code 15 (extended LBA) when creating extended partitions, and both 5 and 15 will be recognized as valid extended partition type codes when scanning existing partitions with `_GPART`. In the description below, "Extended" means "Either extended CHS or extended LBA".
511+
509512
There are many more partition type codes defined, but they refer to filesystems that can't be handled by Nextor so they are not listed here.
510513

511514
A device can have up to four primary partitions, numbered 1 to 4. In order to accommodate more than four partitions, partition number 2 may be of a special type named "Extended". An extended partition is actually a container for more partitions; there is no limit in the number of extra partitions that a partition of type "Extended" can contain. Primary partitions 3 and 4 do not exist when partition 2 is extended.

source/kernel/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# N80=/path/to/N80 make
99

1010

11-
VERSION := 2.1.1
11+
VERSION := 2.1.2
1212

1313
ifeq ($(strip $(N80)),)
1414
N80=N80
@@ -126,11 +126,11 @@ drivers/SunriseIDE/sunride.masteronly.bin: \
126126
$(call assemble_as,drivers/SunriseIDE/sunride.asm,$$/sunride.masteronly.bin,--build-type abs --output-file-extension bin --define-symbols MASTER_ONLY,BAD_POPS)
127127

128128

129-
### Sunrise IDE, ROM for emulators
129+
### Sunrise IDE, ROM for blueMSX
130130

131-
ide-emu: drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.emulators.ROM
131+
ide-emu: drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.blueMSX.ROM
132132

133-
drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.emulators.ROM: \
133+
drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.blueMSX.ROM: \
134134
nextor_base.dat \
135135
drivers/SunriseIDE/driver.bin \
136136
drivers/SunriseIDE/chgbnk.bin \
@@ -146,11 +146,11 @@ drivers/SunriseIDE/driver.bin: \
146146
$(call assemble,drivers/SunriseIDE/driver.mac,--build-type abs --output-file-extension bin)
147147

148148

149-
### Sunrise IDE, ROM for emulators, master device only
149+
### Sunrise IDE, ROM for blueMSX, master device only
150150

151-
ide-masteronly-emu: drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.MasterOnly.emulators.ROM
151+
ide-masteronly-emu: drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.MasterOnly.blueMSX.ROM
152152

153-
drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.MasterOnly.emulators.ROM: \
153+
drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.MasterOnly.blueMSX.ROM: \
154154
nextor_base.dat \
155155
drivers/SunriseIDE/drvmonly.bin \
156156
drivers/SunriseIDE/chgbnk.bin \

source/kernel/bank2/val.mac

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,8 @@
88
INCLUDE ../const.inc
99
RAMMOD
1010

11-
MBR_PSTART equ 01BEh ;Start of partition table in MBR
12-
MBR_PSIZE equ 16 ;Size of partition table entry
13-
POFF_TYPE equ 4 ;Offset of partition type in p. table entry
14-
POFF_PSTART equ 8 ;Offset of partition start in p. table entry
15-
POFF_PSIZE equ 12 ;Offset of partition size in p. table entry
16-
PT_FAT12 equ 1 ;Partition type code for FAT12
17-
PT_FAT16_S equ 4 ;Partition type code for FAT16 (< 32M)
18-
PT_EXT equ 5 ;Partition type code for extended partition
19-
PT_FAT16 equ 6 ;Partition type code for FAT16
20-
PT_FAT16_L equ 14 ;Partition type code for FAT16 (LBA)
21-
MBR_SIG equ 512-2 ;MBR signature offset in MBR (55h, AAh)
2211
MAXCLUS_FAT12 equ 4084
2312
MAXCLUS_12BITS equ 4095
24-
2513
;
2614
;-----------------------------------------------------------------------------
2715
;

source/kernel/bank4/partit.mac

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ POFF_PSTART equ 8 ;Offset of partition start in p. table entry
2323
POFF_PSIZE equ 12 ;Offset of partition size in p. table entry
2424
PT_FAT12 equ 1 ;Partition type code for FAT12
2525
PT_FAT16_S equ 4 ;Partition type code for FAT16 (< 32M)
26-
PT_EXT equ 5 ;Partition type code for extended partition
26+
PT_EXT equ 5 ;Partition type code for extended partition (CHS)
27+
PT_EXT_LBA equ 15 ;Partition type code for extended partition (LBA)
2728
PT_FAT16 equ 6 ;Partition type code for FAT16
2829
PT_FAT16_L equ 14 ;Partition type code for FAT16 (LBA)
2930

@@ -205,7 +206,7 @@ DO_EXTPAR:
205206
;--- If extended partition requested, first check that partition is actually extended
206207

207208
ld a,(ix+POFF_TYPE)
208-
cp PT_EXT
209+
call IS_EXT_PART
209210
jp nz,UNEX_PART
210211

211212
ld a,(ix+POFF_PSTART) ;Save the start sector number of the outer extended partition
@@ -285,7 +286,7 @@ EXTP_NEXT:
285286
pop bc
286287

287288
ld a,(ix+POFF_TYPE)
288-
cp PT_EXT
289+
call IS_EXT_PART
289290
jr nz,TPIY_UNEX_PART
290291

291292
jr EXTP_LOOP
@@ -1232,7 +1233,7 @@ AA_PX_DOEMU:
12321233

12331234
AA_PX_NOEMU:
12341235
ld a,b ;Partition type
1235-
cp PT_EXT
1236+
call IS_EXT_PART
12361237
jr nz,AA_PX_NOEX
12371238
ld a,(ix+AAD_CURR_PART_INDEX)
12381239
or 80h
@@ -3137,7 +3138,7 @@ MAP_SPECIFIC:
31373138

31383139
MAP_DRV_UNK:
31393140
;Unknown change status: assume unchanged media.
3140-
;If it has changed, the boot checksum checksum
3141+
;If it has changed, the boot checksum
31413142
;mechanism will do the work of unassigning
31423143
;all other drives mapped to this device
31433144
;if necessary.
@@ -3147,6 +3148,7 @@ MAP_DRV_UNK:
31473148
MAP_DRV_CH:
31483149
push hl
31493150
push iy
3151+
push bc
31503152
ld e,(hl)
31513153
inc hl
31523154
ld d,(hl)
@@ -3156,6 +3158,7 @@ MAP_DRV_CH:
31563158
ld d,(iy+2)
31573159
ld e,(iy+3)
31583160
call UNMAPALL
3161+
pop bc
31593162
pop iy
31603163
pop hl
31613164

@@ -4169,7 +4172,7 @@ IDRVR_RET:
41694172

41704173
DOSV1_2:
41714174
xor a
4172-
ld b,a
4175+
ld bc,_DOSVER## ;Make B=0 and preserve C, some programs actually check it
41734176
ret
41744177

41754178

@@ -4505,7 +4508,7 @@ MAPDRV_NOP0:
45054508
ld c,_GPART##
45064509
call BASIC_DOS
45074510
ld a,b
4508-
cp 5 ;Extended partition?
4511+
call IS_EXT_PART ;Extended partition?
45094512

45104513
pop bc
45114514
ld a,b
@@ -4540,7 +4543,7 @@ MAPDRV_GOTPAR:
45404543
ld a,b
45414544
or a
45424545
jp z,BASIC_ERR
4543-
cp 5
4546+
call IS_EXT_PART
45444547
jp z,BASIC_ERR ;"Invalid partition" error if non existing or extended partition
45454548
ld e,c
45464549

@@ -6278,5 +6281,16 @@ STRCOMP:
62786281
inc de
62796282
jr STRCOMP
62806283

6284+
6285+
; Check if the partition type passed in A
6286+
; corresponds to a recognized extended partition type,
6287+
; return Z if so or NZ otherwise
6288+
6289+
IS_EXT_PART:
6290+
cp PT_EXT
6291+
ret z
6292+
cp PT_EXT_LBA
6293+
ret
6294+
62816295
finish <PARTIT>
62826296
end

source/kernel/bank5/fdisk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ byte GetDiskPartitionsInfo()
841841
DosCallFromRom(_GPART, REGS_ALL);
842842
error = regs.Bytes.A;
843843
if(error == 0) {
844-
if(regs.Bytes.B == PARTYPE_EXTENDED) {
844+
if(regs.Bytes.B == PARTYPE_EXTENDED || regs.Bytes.B == PARTYPE_EXTENDED_LBA) {
845845
extendedIndex = 1;
846846
} else {
847847
currentPartition->primaryIndex = primaryIndex;

source/kernel/bank5/fdisk2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ int CalculateFatFileSystemParametersFat16(ulong fileSystemSizeInK, dosFilesystem
415415
clusterCount = dataSectorsCount >> sectorsPerClusterPower;
416416
sectorsPerFat = (clusterCount + 2) >> 8;
417417

418-
if(((clusterCount + 2) & 0x3FF) != 0) {
418+
if(((clusterCount + 2) & 0xFF) != 0) {
419419
sectorsPerFat++;
420420
}
421421

@@ -515,7 +515,7 @@ int CreatePartition(int index)
515515

516516
if(index != (partitionsCount - 1)) {
517517
tableEntry++;
518-
tableEntry->partitionType = PARTYPE_EXTENDED;
518+
tableEntry->partitionType = PARTYPE_EXTENDED_LBA;
519519
tableEntry->firstAbsoluteSector = nextDeviceSector;
520520
if(index == 0) {
521521
mainExtendedPartitionFirstSector = nextDeviceSector;

source/kernel/bank6/partit.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)