News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

X-MASS, a mass-storage expansion for all CPC.

Started by TotO, 18:32, 14 December 14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ast

So we can use the x-mass with this fw ?
What are the new functions ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Kris

There are not so much details at the moment; we have to wait for the final release  :D


MacDeath

Ast is really craving for the full use of his X-MASS indeed...
;)

Kris

Quote from: MacDeath on 14:57, 25 February 16
Ast is really craving for the full use of his X-MASS indeed...
;)


Like all of us  ;D

HAL6128

Quote from: Prodatron on 23:08, 23 February 16
We just finished the little formatting tool for the standard X-MASS 128MB DOM storages!
....
Application is attached (source codes included).

Just because I'm curious. Are there any other people who tested that application?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Audronic

#430
Quote from: Ast on 13:43, 25 February 16
So we can use the x-mass with this fw ?
What are the new functions ?
Hi Ast
The only information that i have is :-
Below is a quote from Syx in the GitHub

FW3.1X
A few patches for the original firmware of the Amstrad CPC.
Last version: 3.16
Changeling:

Disabled the ram disk for the launch of the XMASS rom.

       
  • For games that reinitialize the firmware, but never set the screen mode to 1 (GAC, PAW, DAAD, ...), you can press the key 1 during the load to change the screen mode to 1, instead of the default screen mode 2.

       
  • And other fixes that i don't remember now.

       
  • Ray
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

Ast

#431
Do i have to use ata doc or Microsoft ide doc when i send #ec command ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

HAL6128

@Ast : you have to consider the ATA documentation. The identify device has nothing to do with the (a) filesystem.

By the way: the fw3.1x has also nothing to do (as far as I can see today) with a integration of the X-Mass in the CPC environment. No driver (system )has been included. You need or wait for the extra ROM or software to communicate with the X-Mass.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

arnoldemu

Quote from: Ast on 22:41, 25 February 16
Do i have to use ata doc or Microsoft ide doc when i send #ec command ?
ata doc for hardware (e.g. nec765 for disc)
microsoft doc for filesystem (e.g. cpm/amsdos for disc)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Ast

So how can i do to give back count sector, sector number, cylnder low and high and adress of directory or which position?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

arnoldemu

Quote from: Ast on 22:53, 25 February 16
So how can i do to give back count sector, sector number, cylnder low and high and adress of directory or which position?
this would be in the microsoft doc because it is part of filesystem.

i dont know if the x-mass is partitioned.

with fat filesystem there is 1 root directory. inside the root directory there are entries for files and sub-directories with the cluster of the start of the file. the is the number in the fat table. Then you can follow the chain of clusters to find all parts of the file or sub-directory.


My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Ast

I really need help from those who know...
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

HAL6128

#437
...so, everything what you need (or I read out of you question) is described in the MS-Filesystem (FAT16/32):

Normally the X-Mass is not used to be partioned. So, there is no MBR (with a partition table), but a Boot-Sector of a file sytem (FAT16) on the first physical sector.

Regarding the MS-Spec: You only have to take care (...in the spec) between the difference of a FAT16 FS with a fixed position of the beginning of the Root-Directory ( e.g. Boot-Sector at LBA0, first FAT-table at LBA1, second FAT-table at LBAxxx and Root-Directory at LBAxxx, the information of xxx  has to be calculated with information in the Boot-Sector) and the FAT32 with a flexible Root-Directory which start at (normally) cluster 2. So, you have to calculate or find the information about cluster size, reserved sectors, sector size and multiplicate it as an offset to the start of the Boot-Sector.

I don't know how now how the formatting application from SyX/TotO determines the sectors of the DOM, so addresses could differ, but the formatting tool of Prodatron deliver a fixed BS at LBA0, first FAT-table at LBA1, second FAT-table at LBA257, Root-Direcotry-entry at LBA513. E.g. read the sector at address LBA513 you will read the first 32 entries of the Root-Directory (like CP/M).
But, if you want to stay flexible you have to calculate with the infos out of the Boot-Sector.
If you want to create an formatting application, you should need at least the information of the whole sector numbers of the drive, which could be provided by the &EC ATA command, and then calculate with the help of the MS-Spec. the cluster size etc. (as far as I know...)
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

HAL6128

Ok, maybe this will also help (LBA28Bit):
#FD0B  Sector Number  Sector Number  = LBA low (0-7)
#FD0C  Cylinder Low  Cylinder Low  = LBA mid (8-15)
#FD0D  Cylinder High  Cylinder High  = LBA high (16-23)
...
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Ast

Quote from: HAL 6128 on 23:32, 25 February 16
Ok, maybe this will also help (LBA28Bit):
#FD0B  Sector Number  Sector Number  = LBA low (0-7)
#FD0C  Cylinder Low  Cylinder Low  = LBA mid (8-15)
#FD0D  Cylinder High  Cylinder High  = LBA high (16-23)
...
I already know that... What i want to know is where i can find these information when i send #ec command... In which adress, offset.?.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Ast

When i put #ec ata command i can't use ata doc or microsoft ide doc, because the informations are not present in the offset given...
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

HAL6128

#441
You can't gain that information with the help of &EC. The ATA command will only provide information from the hardware, not filesystem.
The ATA command doesn't read the first sector, it's a hardware given information stored somewhere, maybe not on disc.

Read the first sector then look after (e.g. FAT32)

[attachimg=1]:
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Ast

#442
So i must use the #20 ata command to read a sector, am i ok with that ?
But which sector ? And which cylinder low, high ?
Sector count and sector number may have to be 1 and cylinder high and low must be 0 ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

gerald

Quote from: Ast on 23:54, 25 February 16
So i must use the #20 ata command to read a sector, am i ok with that ?
But which sector ? And which cylinder low, high ?
Sector count and sector number may have to be 1 and cylinder high and low must be 0 ?
To make it simple, just forget about Sector/Cylinder/Track.
Just consider the device as a collection of 512 byte LBA.
If you only want to read/write to an existing partition, you can even forget about the identify device command.

At the beginning, you just read LBA0, which may contains a MBR, a FAT, or anything else like custom boot sector/ RDB / GUID)
You need to guess what is inside by verifying signature (ie 55AA et end of LBA for FAT/MBR, "FAT" in FAT ...)

If you have a MBR, just take the partition records in order, it will tell you where the partition is, its type etc. Then read the LBA given and check that you have a FAT or not.

If you have a fat boot sector (either at LBA 0, or partition 1st LBA), you now have to use the microsoft documentation to access your data.

arnoldemu

Quote from: Ast on 23:54, 25 February 16
So i must use the #20 ata command to read a sector, am i ok with that ?
But which sector ? And which cylinder low, high ?
Sector count and sector number may have to be 1 and cylinder high and low must be 0 ?
It is easier to work with LBA numbers. These are 0-max. (max is the number of 512 byte sectors on the device).

The ATA doc describes which bits of LBA go into each register. Cylinder high,low, sector registers etc are re-used in LBA mode to define some bits of the LBA.

Use #20 ata command to read.

To find which LBA to read with #20 follow gerald's advice. Read the MBR from LBA 0, find the partitions, read the partition, find the root directory etc.


My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

#ec command tells you the number of 512 sectors in the device.
It tells the drives identity, and tells you which version of ATA it supports so you know which commands will work or not.

#20 is in ATA specification 1 and is supported by all specifications so it is good to use this.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Ast

What i found :

to select LBA mode, you must set bit 6 to 1 in Device/Head register so :


ld a,0+%01000000 ; set bit 6 to 1
ld bc,#fd0e ; ide Device/Head
out (c),a
;
bit 0...3 are used to select Head


is it good or not ?

Now, sector number, cylinder low and cylinder high & Device/Head composes Lba28 adress.

Is it that or not ?

-Count sector will always be 1 ?
-How can i do to switch off x-Mass light after reading the sector using the #20 command ?
-How can i do to reset x-Mass instead of switch off my Cpc ?



_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

gerald

Quote from: Ast on 13:01, 26 February 16
What i found :

to select LBA mode, you must set bit 6 to 1 in Device/Head register so :


ld a,0+%01000000 ; set bit 6 to 1
ld bc,#fd0e ; ide Device/Head
out (c),a
;
bit 0...3 are used to select Head


is it good or not ?
Good, more or less. If you write a generic driver, you have to add the 4 MSB of the LBA in the 4 LSB of that register

Quote from: Ast on 13:01, 26 February 16
Now, sector number, cylinder low and cylinder high & Device/Head composes Lba28 adress.

Is it that or not ?
Yes

Quote from: Ast on 13:01, 26 February 16
-Count sector will always be 1 ?
No, you can request up to 256 sector (0=256). Returned sector are all contiguous. If you request LBA0010 and 5 sector, you will get LBA0010, LBA0011 ... LBA0015.

Quote from: Ast on 13:01, 26 February 16
-How can i do to switch off x-Mass light after reading the sector using the #20 command ?
The light will stay on as long as its buffer is not empty. Did you read all data ?

Quote from: Ast on 13:01, 26 February 16
-How can i do to reset x-Mass instead of switch off my Cpc ?
Send a reset command, but then you will have to configure the DOM to 8bit mode again.

Ast

Quote from: gerald on 13:18, 26 February 16
Good, more or less. If you write a generic driver, you have to add the 4 MSB of the LBA in the 4 LSB of that register
Yes
No, you can request up to 256 sector (0=256). Returned sector are all contiguous. If you request LBA0010 and 5 sector, you will get LBA0010, LBA0011 ... LBA0015.
The light will stay on as long as its buffer is not empty. Did you read all data ?
Send a reset command, but then you will have to configure the DOM to 8bit mode again.

-the 4 LSB of that registers are used to select drive/side ? so 0 is good no ?
-How to select LBA0010 ? what value can i put in the LBA28 address ?
-buffer is not empty... I think i read all data. I used a routine like that :


          ld bc,#fd08 ; ide data register
          ld hl,buffer  ; data read will be set at buffer
          ld de,512    ; size of one sector
rd       in a,(c)
          ld (hl),a
          dec de
          inc hl
          ld a,d
          or e
          jr nz,rd

_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

gerald

Quote from: Ast on 13:34, 26 February 16
-the 4 LSB of that registers are used to select drive/side ? so 0 is good no ?
The 4 lsb of CDH register are LBA[27:24] bit when in LBA mode. You will need them for drive bigger than 8GB.

Quote from: Ast on 13:34, 26 February 16
-How to select LBA0010 ? what value can i put in the LBA28 address ?
If DEHL contains your LBA, you just put
  L in SECNUM (register 3)
  H in CYLLOW (register 4)
  E in CYLHIGH (register 5)
  (D and 0x0F) or 0x40[nb]or 0xE0, bit 7 and 5 are obsolete in later IDE spec, but i older one, these bit have to be set at 1[/nb] in CDH (register 6)

Remember that you have to fill all relevant register before writing the command.

Quote from: Ast on 13:34, 26 February 16
-buffer is not empty... I think i read all data. I used a routine like that :


          ld bc,#fd08 ; ide data register
          ld hl,buffer  ; data read will be set at buffer
          ld de,512    ; size of one sector
rd       in a,(c)
          ld (hl),a
          dec de
          inc hl
          ld a,d
          or e
          jr nz,rd

Did you wait for the data ready flag ?
After sending a command, you have to poll the status register. As long as bit 7 of this register is high, the command is still in progress and other bit are not valid. Reading data register during this time will return garbage.

Powered by SMFPacks Menu Editor Mod