News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Joseman

winape + Symbiface 2 + IDE devices

Started by Joseman, 23:15, 05 May 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joseman

Hi

I think that it was discussed before... but, i can't make work an ide device on winape.

Bonnydos always shows "drive: ---".

Anyone can explain how to make winape work with ide devices?

and the "ide file" i don't know what format to use. Anyone has an "ide file" working on winape to share?


KaosOverride

#1
If you have a 1 or 2gb FAT16/32 compactflash or other memory card, with no partition table (Formated with RMPrepUSB as USB-FDD) dump it to a file with Winimage


Or if you use Linux create a 1gb file and "format" it with mkfs.fat95 (depends of distro, mkfs.vfat, etc...)


Then use that file with symbos under winape. (Configure for no partition)


Works? If you did it well, then it should work ok.


The problem is, I think, that the "drive" emulation just answers to some IDE commands, the basic for read and write sectors and little more needed to access a known geometry Fat partition dump. All the info is at the FAT header, number of sectors, etc.


But raw geometry is not well emulated, no vendor model info, etc.


I ported an IDE drive info for symbiface, works on real hardware, not at emulators... BDos needs some raw geometry data that the drive should give, but FAT header has the needed replica of that info, so FAT "drives" will work under emulator, other dumps not...


Please someone tell me if I'm not correct.


I uploaded the IDE info drive util link to this forum at a threath asking for the IDE status command, but I think it's also at my MEGA folder at my signature at Amstrad.es.


Edit:

https://mega.co.nz/#!yFlVQAYC!z6LuJaI5u1zZpjBvavtgz4mCQs3VRZ4oFyZszX0_rk0


Here it is.


Source has a custom crt0 header to let return to Basic without messing things with a Run" 
KaosOverride · GitHub
MEGA Amstrad Public Amstrad folder

Prodatron

BDOS is using CHS mode for addressing sectors. For this mode you need to know the geometry of the harddisc. I guess WinApe doesn't supports the IDE info command or CHS addressing mode, so BDOS won't work in WinApe.
SymbOS is using LBA mode for addressing sectors, which is the faster way as you don't need to calculate head and track numbers anymore.

Regarding the geometry:
In the 90ies (or even earlier?) harddiscs started to provide only fake data for the old CHS mode: The heads and tracks you addressed didn't exist in reality as the geometry of the harddisc became more complex (more sectors in tracks close to the edge of the platter, less in tracks in the middle, additional spare sectors which replace damaged ones etc.). So CHS mode was only still existing for compatibility with old software but didn't make sense anymore compared to LBA mode.

In LBA mode you don't need any additional information about the device when accessing existing partitions, as the total size is stored in the MBR and the partition header.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Joseman

Now we need a rom for patching AMSDOS compatible with LBA & FAT32  :(

i'm waiting for ACMEDOS, this will be tha bomb!

@Prodatron, SYMDOS was a great idea, why is not in development anymore?





Prodatron

Quote from: Joseman on 19:45, 06 May 15@Prodatron, SYMDOS was a great idea, why is not in development anymore?

I don't know. It was Flynns idea and project (the WinCPC author), but he disappeared suddenly. The Amsdos FAT implementation of Nilquader, which was nearly finished end of last year (it was based on his working NCxxx SD card driver), has been canceled, too. There seem to be a curse on FAT implementations for the CPC??

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

HAL6128

#5
@Prodatron: Just a question. In the Wiki there are two Low-Level-Routines from you to set an address before reading / writing command. Is it correct that I only could use the "IDE48B -> set 48bit address"-Routine (LBA-mode) and not the "IDEADR -> set address" is for CHS mode?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Prodatron

This article:
SYMBiFACE II:IDE routines - CPCWiki
includes a routine for 28bit LBA or normal CHS addressing and 48bit LBA addressing.

"IDEADR" can be used for both 28bit LBA and CHS, you just have to set the SDH register in a different way to activate LBA or not.
When using 28bit LBA mode you use the following parameters:
Sector = LBA Bit 0-7 (E register)
Track = LBA Bit 8-23 (HL register)
Head = LBA Bit 24-27 (D register)
The upper three bits of the SDH (head+modus -> D) register (bit 5,6,7) must be set to 1, bit 4 selects master(0)/slave(1).

Would be helpful to expand the descriptions in this article a little bit with these information.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

HAL6128

#7
Today I tried a little bit by testing your routines in WinApe. If I want to read - let's say - the MBR, is my preparing for the Input HL=&0000, DE=&A000 and BC=&0100 (just to read one sector)?
What is that "call subslp" in the iderdy (Busy-Routine) about? Is that for reading out another Bit (6 or 0) or another waiting loop?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Prodatron

Quote from: HAL 6128 on 22:15, 06 May 15
Today I tried a little bit by testing your routines in WinApe. If I want to read - let's say - the MBR, is my preparing for the Input HL=&0000, DE=&A000 and BC=&0100 (just to read one sector)?
What is that "call subslp" in the iderdy (Busy-Routine) about? Is that for reading out another Bit (6 or 0 )?
Register values seem to be fine!
SubSlp is SymbOS specific and does a "sleep" (RST #30) inside the multitasking environment to pass the CPU time to other tasks for a while. This usually takes 1 framefly, so in the CPCs standard singletasking environment you can replace it with CALL #BD19 or whatever to wait a little bit and do something else.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

HAL6128

Oh, thanks.
Just my last question: the general steps for handling a Harddisc are:
1. Wait for drive ready
2. Wait for data request
3. Issue a command
4. Read or Write
(5. Anlayse the data in RAM)?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Prodatron

#10
Yes, it's exactly like this:
- wait for "ready"
- write SDH register
- wait for "ready"
- write all other LBA parameters (or CHS)
- write command
- wait for "datarequest"
- send/receive 512byte sector
- check error status
If you need more help please ask, I would be very happy to help you with any IDE project :)

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Joseman

Quote from: Prodatron on 21:15, 06 May 15
The Amsdos FAT implementation of Nilquader, which was nearly finished end of last year (it was based on his working NCxxx SD card driver), has been canceled, too. There seem to be a curse on FAT implementations for the CPC??

And is not possible to get the source code?

if the project is canceled, why not share it with the community?

I don't understand sometimes...

Prodatron

Quote from: Joseman on 23:59, 06 May 15
And is not possible to get the source code?

if the project is canceled, why not share it with the community?

I don't understand sometimes...

We have to accept, that these are hobby projects. People are not forced to finish something, but it may motivate others to do it.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Joseman

i'm not saying that nobody must finish anything! but if you decide to leave the project... then make it open source an make all avaliable, perhaps someone will continue your project...

Prodatron

Yes, but as I said, there seem to be a curse on this on the CPC ;)

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

CraigsBar

#15
Quote from: Prodatron on 10:10, 07 May 15
Yes, but as I said, there seem to be a curse on this on the CPC ;)
my hope is with @SyX and acmedos.
IRC:  #Retro4All on Freenode

Joseman


HAL6128

Quote from: Prodatron on 22:54, 06 May 15
Yes, it's exactly like this:
- wait for "ready"
- write SDH register
- wait for "ready"
- write all other LBA parameters (or CHS)
- write command
- wait for "datarequest"
- send/receive 512byte sector
- check error status
If you need more help please ask, I would be very happy to help you with any IDE project :)
I got it working! Thanks again.
I'm able to read and analyse the boot sector of WinApe's "blank.ide". It seems to be a somehow assembled FAT32-Image out of WindowNT/XP. But I'm not very familiar with further addressing via LBA. If I want to find e.g. the Root-Directory (better the the LBA) of the first DATA-Cluster, I took a look into the Boot Sector table where I can find the Information of 512 Bytes per Sector / 2 FATs / 10768 Sectors per FAT32 Cluster / Hidden Sectors: 63. Normally I should be able to calculate the address.
I calculated: &5440.
For the 48-Bit addressing (LBA) I loaded Register IX (32-47) with &0000, HL (16-31) with &0000 and DE (0-15) with &5440, A (SDH) with &0A and E with &01.
With without success (only &FF the next 512 Bytes)
What do I do wrong?
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Prodatron

Let me check this tomorrow! (too late today)

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Prodatron

WinApe doesnt support LBA48bit.
Did you already try the LBA28bit addressing methode? This should work fine.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

HAL6128

Yes, you are right. I used LBA48Bit addressing. With 28Bit addressing I have success and an entry to the right calculated cluster to the root Directory where SymbOS is installed.
Cheers.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Prodatron

Wow, really cool! Are you preparing something?? :)

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

HAL6128

First I was just curious about your Low-Level-Routines, how they work, am I able to understand them. The topic becomes interesting, but I doubt that I am able to understand the FAT32 filesystem properly enough to create something. MS FAT32 specs are hard to read or at least to understand (for me). :D
Let's see.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Prodatron

If you have any questions regarding FAT, just ask! It's much improved compared to CP/M, but it's still very simple and logical and still easy to handle on an 8bit machine. IMHO the Microsoft documentation is written in a very good way, as it is even talking about problems regarding missunderstanding of special definitions (the typical "by 0"/"by 1" problem and other things like "what are the REAL rules for detecting if it's FAT16 or FAT32" etc. etc.).

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Executioner

Quote from: Prodatron on 08:05, 09 May 15
WinApe doesnt support LBA48bit.
Did you already try the LBA28bit addressing methode? This should work fine.

I didn't even know it existed until you mentioned it here. I'll look at implementing LBA-48 but only up to 2TB for now.

Powered by SMFPacks Menu Editor Mod