Skip to content

Commit

Permalink
Merge pull request #136 from Konamiman/v2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Konamiman committed Dec 1, 2023
2 parents 181d3e0 + bdbdcba commit 3a1e520
Show file tree
Hide file tree
Showing 17 changed files with 594 additions and 133 deletions.
2 changes: 1 addition & 1 deletion docs/Nextor 2.1 Getting Started Guide.md
Expand Up @@ -41,7 +41,7 @@ This section explains the steps needed to setup blueMSX in order to follow this

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

* 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).
* 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.

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

Expand Down
5 changes: 4 additions & 1 deletion docs/Nextor 2.1 Programmers Reference.md
Expand Up @@ -501,11 +501,14 @@ The partition type code returns information about the filesystem that the partit
0: None (the partition with the specified number does not exist)
1: FAT12
4: FAT16, smaller than 32MB (obsolete)
5: Extended (see below)
5: Extended (CHS) (see below)
6: FAT16 (CHS)
14: FAT16 (LBA)
15: Extended (LBA)
```

**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".

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.

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.
Expand Down
14 changes: 7 additions & 7 deletions source/kernel/Makefile
Expand Up @@ -8,7 +8,7 @@
# N80=/path/to/N80 make


VERSION := 2.1.1
VERSION := 2.1.2

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


### Sunrise IDE, ROM for emulators
### Sunrise IDE, ROM for blueMSX

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

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


### Sunrise IDE, ROM for emulators, master device only
### Sunrise IDE, ROM for blueMSX, master device only

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

drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.MasterOnly.emulators.ROM: \
drivers/SunriseIDE/Nextor-$(VERSION).SunriseIDE.MasterOnly.blueMSX.ROM: \
nextor_base.dat \
drivers/SunriseIDE/drvmonly.bin \
drivers/SunriseIDE/chgbnk.bin \
Expand Down
12 changes: 0 additions & 12 deletions source/kernel/bank2/val.mac
Expand Up @@ -8,20 +8,8 @@
INCLUDE ../const.inc
RAMMOD

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

;
;-----------------------------------------------------------------------------
;
Expand Down
30 changes: 22 additions & 8 deletions source/kernel/bank4/partit.mac
Expand Up @@ -23,7 +23,8 @@ POFF_PSTART equ 8 ;Offset of partition start in p. table entry
POFF_PSIZE equ 12 ;Offset of partition size in p. table entry
PT_FAT12 equ 1 ;Partition type code for FAT12
PT_FAT16_S equ 4 ;Partition type code for FAT16 (< 32M)
PT_EXT equ 5 ;Partition type code for extended partition
PT_EXT equ 5 ;Partition type code for extended partition (CHS)
PT_EXT_LBA equ 15 ;Partition type code for extended partition (LBA)
PT_FAT16 equ 6 ;Partition type code for FAT16
PT_FAT16_L equ 14 ;Partition type code for FAT16 (LBA)

Expand Down Expand Up @@ -205,7 +206,7 @@ DO_EXTPAR:
;--- If extended partition requested, first check that partition is actually extended

ld a,(ix+POFF_TYPE)
cp PT_EXT
call IS_EXT_PART
jp nz,UNEX_PART

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

ld a,(ix+POFF_TYPE)
cp PT_EXT
call IS_EXT_PART
jr nz,TPIY_UNEX_PART

jr EXTP_LOOP
Expand Down Expand Up @@ -1232,7 +1233,7 @@ AA_PX_DOEMU:

AA_PX_NOEMU:
ld a,b ;Partition type
cp PT_EXT
call IS_EXT_PART
jr nz,AA_PX_NOEX
ld a,(ix+AAD_CURR_PART_INDEX)
or 80h
Expand Down Expand Up @@ -3137,7 +3138,7 @@ MAP_SPECIFIC:

MAP_DRV_UNK:
;Unknown change status: assume unchanged media.
;If it has changed, the boot checksum checksum
;If it has changed, the boot checksum
;mechanism will do the work of unassigning
;all other drives mapped to this device
;if necessary.
Expand All @@ -3147,6 +3148,7 @@ MAP_DRV_UNK:
MAP_DRV_CH:
push hl
push iy
push bc
ld e,(hl)
inc hl
ld d,(hl)
Expand All @@ -3156,6 +3158,7 @@ MAP_DRV_CH:
ld d,(iy+2)
ld e,(iy+3)
call UNMAPALL
pop bc
pop iy
pop hl

Expand Down Expand Up @@ -4169,7 +4172,7 @@ IDRVR_RET:

DOSV1_2:
xor a
ld b,a
ld bc,_DOSVER## ;Make B=0 and preserve C, some programs actually check it
ret


Expand Down Expand Up @@ -4505,7 +4508,7 @@ MAPDRV_NOP0:
ld c,_GPART##
call BASIC_DOS
ld a,b
cp 5 ;Extended partition?
call IS_EXT_PART ;Extended partition?

pop bc
ld a,b
Expand Down Expand Up @@ -4540,7 +4543,7 @@ MAPDRV_GOTPAR:
ld a,b
or a
jp z,BASIC_ERR
cp 5
call IS_EXT_PART
jp z,BASIC_ERR ;"Invalid partition" error if non existing or extended partition
ld e,c

Expand Down Expand Up @@ -6278,5 +6281,16 @@ STRCOMP:
inc de
jr STRCOMP


; Check if the partition type passed in A
; corresponds to a recognized extended partition type,
; return Z if so or NZ otherwise

IS_EXT_PART:
cp PT_EXT
ret z
cp PT_EXT_LBA
ret

finish <PARTIT>
end
2 changes: 1 addition & 1 deletion source/kernel/bank5/fdisk.c
Expand Up @@ -841,7 +841,7 @@ byte GetDiskPartitionsInfo()
DosCallFromRom(_GPART, REGS_ALL);
error = regs.Bytes.A;
if(error == 0) {
if(regs.Bytes.B == PARTYPE_EXTENDED) {
if(regs.Bytes.B == PARTYPE_EXTENDED || regs.Bytes.B == PARTYPE_EXTENDED_LBA) {
extendedIndex = 1;
} else {
currentPartition->primaryIndex = primaryIndex;
Expand Down
4 changes: 2 additions & 2 deletions source/kernel/bank5/fdisk2.c
Expand Up @@ -415,7 +415,7 @@ int CalculateFatFileSystemParametersFat16(ulong fileSystemSizeInK, dosFilesystem
clusterCount = dataSectorsCount >> sectorsPerClusterPower;
sectorsPerFat = (clusterCount + 2) >> 8;

if(((clusterCount + 2) & 0x3FF) != 0) {
if(((clusterCount + 2) & 0xFF) != 0) {
sectorsPerFat++;
}

Expand Down Expand Up @@ -515,7 +515,7 @@ int CreatePartition(int index)

if(index != (partitionsCount - 1)) {
tableEntry++;
tableEntry->partitionType = PARTYPE_EXTENDED;
tableEntry->partitionType = PARTYPE_EXTENDED_LBA;
tableEntry->firstAbsoluteSector = nextDeviceSector;
if(index == 0) {
mainExtendedPartitionFirstSector = nextDeviceSector;
Expand Down
54 changes: 0 additions & 54 deletions source/kernel/bank6/partit.h

This file was deleted.

0 comments on commit 3a1e520

Please sign in to comment.