Skip to content

Commit

Permalink
Merge pull request #436 from kiwisincebirth/map/move-hbios-diomed
Browse files Browse the repository at this point in the history
move hbios function diomed
  • Loading branch information
wwarthen authored Oct 12, 2024
2 parents ea6e31c + acce0ec commit 0f63bb0
Show file tree
Hide file tree
Showing 9 changed files with 370 additions and 331 deletions.
6 changes: 3 additions & 3 deletions Doc/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Version 3.5
- WBW: Add Warm/Cold reboot options to CPUSPD utility
- D?N: Added support for eZ80 CPU
- MAP: Contributed COPYSL utility
- MAP: Added new HBIOS function SYSGET_DIOMED
- MAP: ROMLDR now uses SYSGET_DIOMED to get Slice Sector for boot
- MAP: CBIOS now uses SYSGET_DIOMED during drive selection
- MAP: Added new HBIOS function EXT_SLICE (orginally SYSGET_DIOMED)
- MAP: ROMLDR now uses EXT_SLICE to get Slice Sector for boot
- MAP: CBIOS now uses EXT_SLICE during drive selection

Version 3.4
-----------
Expand Down
Binary file modified Doc/RomWBW System Guide.pdf
Binary file not shown.
3 changes: 1 addition & 2 deletions Source/CBIOS/cbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1388,8 +1388,7 @@ DSK_MBR:
LD D,A
LD A,(SLICE) ; AND SLICE
LD E,A
LD B,BF_SYSGET ; HBIOS FUNC: SYS GET
LD C,BF_SYSGET_DIOMED ; HBIOS SUB-FUNC: GET DISK INFO
LD B,BF_EXTSLICE ; HBIOS FUNC: SLICE
RST 08 ; DO IT
;
; CHECK ERRORS FROM THE FUNCTION
Expand Down
94 changes: 49 additions & 45 deletions Source/Doc/SystemGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,11 @@ differentiate (at the oerating system level) between the Classic and Modern layo
However HBIOS itself typically does NOT make this distinction, since the use
of these two formats is determined by the operating system based on the
partition table on the media.

There are two important HBIOS functions that deal with Media ID.

[Function 0x18 -- Disk Media (DIOMEDIA)]
* [Function 0x18 -- Disk Media (DIOMEDIA)]

[SYSGET Subfunction 0x12 -- Get Extended Disk Media (DIOMED)]
* [Function 0xE0 -- Calculate Slice (EXTSLICE)]

# System Boot Process

Expand Down Expand Up @@ -1107,7 +1106,7 @@ devices. See the section [Mapping to Media ID] for information on this.
To determine if an HD1K formatted partition exists on the hard disk
please see the following function.

[SYSGET Subfunction 0x12 -- Get Extended Disk Media (DIOMED)]
[Function 0xE0 -- Calculate Slice (EXTSLICE)]

### Function 0x19 -- Disk Define Media (DIODEFMED)

Expand Down Expand Up @@ -2221,6 +2220,51 @@ approximately B5.

`\clearpage`{=latex}

## Extension (EXT)

Helper (extension) functions that are not a core part of a BIOS.

### Function 0xE0 -- Calculate Slice (EXTSLICE)

| **Entry Parameters** | **Returned Values** |
|----------------------------------------|----------------------------------------|
| B: 0xE0 | A: Status |
| D: Disk Unit | B: Device Attributes |
| E: Slice | C: Media ID |
| | DEHL: Sector Address |

Report the Media ID (C), and Device Attributes (B) for the for media in the
specified Disk Unit (D), and for hard disks the absolute Sector offset to the
start of the Slice (E). The Status (A) is a standard HBIOS result code.

This function extends upon [Function 0x18 -- Disk Media (DIOMEDIA)] for hard
disk media by scanning for a partition to determine if the disk uses HD512
or HD1K, correctly reporting MID_HD or MID_HDNEW respectively.
See the folowing for some background [Mapping to Media ID]

It will also return the sector number of the first sector in the
slice if the slice number is valid. If the slice number is invalid
(it wont fix on the media) an error will be returned.

The slice calculation is performed by considering the partition start
(if it exists), the size of a slice for the given format type, and ensuring
that the slice fits within the media or partition size, taking into
consideration other partitions that may exist.

The Device Attributes (B) are the same as defined in
[Function 0x17 -- Disk Device (DIODEVICE)]

If the Unit specified is not a hard disk the Media ID will be returned and
the slice parameter ignored. If there is no media in device, or the slice
number is invaid (Parameter Out Of Range) the function will return an error status.

**NOTE:
This function was placed in HBIOS to be shared between the diffeent CP/M
varients supported by RomWBW. It is not strictly a BIOS function,
and may be moved in future.

`\clearpage`{=latex}

## System (SYS)

### Function 0xF0 -- System Reset (SYSRESET)
Expand Down Expand Up @@ -2265,7 +2309,7 @@ The Version (DE)number is encoded as BCD where the 4 digits are:

[Major Version][Minor Version][Patch Level][Build Number]

So, for example, a Version (L) number of 0x3102 would indicate
So, for example, a Version (DE) number of 0x3102 would indicate
version 3.1.0, build 2.

The hardware Platform (L) is identified as follows:
Expand Down Expand Up @@ -2489,46 +2533,6 @@ the caller can use interbank calls directly to the function in the
driver which bypasses the overhead of the normal function invocation
lookup.

#### SYSGET Subfunction 0x12 -- Get Extended Disk Media (DIOMED)

| **Entry Parameters** | **Returned Values** |
|----------------------------------------|---------------------------------------|
| B: 0xF8 | A: Status |
| C: 0x12 | B: Device Attributes |
| D: Disk Unit | C: Media ID |
| E: Slice | DEHL: Sector Address |

Report the Media ID (C), and Device Attributes (B) for the for media in the
specified Disk Unit (D), and for hard disks the absolute Sector offset to the
start of the Slice (E). The Status (A) is a standard HBIOS result code.

This function extends upon [Function 0x18 -- Disk Media (DIOMEDIA)] for hard
disk media by scanning for a partition to determine if the disk uses HD512
or HD1K, correctly reporting MID_HD or MID_HDNEW respectively.

**NOTE: This is contrary to the design of HBIOS. See the section
[Mapping to Media ID] for information on this.
This function was placed in HBIOS to be shared between the diffeent CP/M
varients supported by RomWBW, and may be moved in future.

It will also return the sector number of the first sector in the
slice if the slice number is valid. If the slice number is invalid
(it wont fix on the media) an error will be returned.

The slice calculation is performed by considering the partition start
(if it exists), the size of a slice for the given format type, and ensuring
that the slice fits within the media or partition size, taking into
consideration other partitions that may exist.

The Device Attributes (B) are the same as defined in
[Function 0x17 -- Disk Device (DIODEVICE)]

If the Unit specified is not a hard disk the Media ID will be returned and
the slice parameter ignored. If there is no media in device, or the slice
number is invaid (Parameter Out Of Range) the function will return an error status.

Also see [Function 0x18 -- Disk Media (DIOMEDIA)]

#### SYSGET Subfunction 0x20 -- Get RTC Device Unit Count (RTCCNT)

| **Entry Parameters** | **Returned Values** |
Expand Down
Loading

0 comments on commit 0f63bb0

Please sign in to comment.