ENTERPRISE KLUB
2019. május 25., 1055 Budapest, Nyugati tér 9. 14-19 óráig
Részletek
Welcome, Guest. Please login or register.


Author Topic: SD extension (Read 1701 times)

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
SD extension
« on: 2014.May.12. 22:13:53 »
I have a question on the driver setup, Zozo. In your driver you have:

Code: [Select]
SPUF:           EQU 01800H
RAMMERET:       EQU 1A00H
RAM_START: EQU 0E000h ;RAM terület kezdete
In mine I have:
Code: [Select]
SPUF:           EQU 0x0D00 ;Sector buffer offset
RAMMERET:       EQU 0x0F00 ;Mapped RAM size
RAM_START: EQU 0xF000 ;Start of mapped RAM, initialised to 0
However I'm not sure about SPUF. It seems to be used as an address in the code, not as an offset into the RAM section of the 16K ROM as I expected.

Also, I'm not sure about the amount of RAM free. Am I ok with 4kb-256b, or do I need 8kb?

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 28.0 Firefox 28.0
    • View Profile
    • http://enterprise.iko.hu/
Re: SD extension
« Reply #1 on: 2014.May.12. 22:19:28 »
SPUF are temporary sector buffer during the partition detection. Currently on Page 0, but later possible to move to another segment.

Currently 4K looks ok. But if possible 8K then better, because both SD device have a similar configuration, more easy to develop.
« Last Edit: 2014.May.12. 22:22:54 by Zozosoft »

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
Re: SD extension
« Reply #2 on: 2014.May.12. 22:36:07 »
Thanks Zozo. I have the driver detecting my card and showing the right number of sectors now, but I only have FAT16 and FAT32 formatted cards and when I try and access F:, I get "Invalid Drive", which I guess is expected as its not FAT12?

What's the best way to get a FAT12 formatted SD card? You cant just format from Win7 to FAT12 any more, FAT16 is the lowest supported.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 28.0 Firefox 28.0
    • View Profile
    • http://enterprise.iko.hu/
Re: SD extension
« Reply #3 on: 2014.May.12. 22:49:05 »
Yes currently only FAT12 supported by EXDOS.
Most easy way write out preformated VHD files to the card (I use Winimage 9.0).

Empty VHD files.
CHD with lot of programs.

Note: exist a card reader which are can't handle SD cards formated with FAT12.
I have a Hama "19 in 1 USB 2.0", Point of View "ALL-IN-1", Lenovo Thinkpad X60 and X220 built in SD slot, these are working. And have one DeLock, this is not working.

Under the stupid Windows you only see the first partition of the card. I readed somewhere need to modify one bit in the USB card reader driver, then the Windows think it is USB hard drive, then all partitions handled...

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
Re: SD extension
« Reply #4 on: 2014.May.12. 23:26:22 »
How do you write the disk image? All I can find is "Write Disk" which resizes the image to match my SD card (4gb) and writes this to the card?!

It doesn't seem to want to just write the raw sectors to the disk.

Edit: Never mind! Restore Virtual Hard Disk image is what you need... :)

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
Re: SD extension
« Reply #5 on: 2014.May.12. 23:32:58 »
Hmm, now the SDEXT detects partitions F:-K:, but doing dir of F: from the EXDOS command interpreter returns "Invalid Drive". Not sure why as it appears to be reading the sectors correctly as it recognises the partitions.

Could be because I have not yet finished writing read CID and OCR, only CSD to return the number of sectors?

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Unknown Unknown
  • Browser:
  • Opera 9.80 (Opera Mini 7.5.35199) Opera 9.80 (Opera Mini 7.5.35199)
    • View Profile
    • http://enterprise.iko.hu/
Re: SD extension
« Reply #6 on: 2014.May.12. 23:49:27 »
The EXDOS and SDEXT placed to which segments? SDEXT needed to higher segment, because need to detect partitions before the EXDOS ask it.

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Mac OS X Mac OS X
  • Browser:
  • Safari 6.0 Safari 6.0
    • View Profile
Re: SD extension
« Reply #7 on: 2014.May.12. 23:57:08 »
The EXDOS and SDEXT placed to which segments? SDEXT needed to higher segment, because need to detect partitions before the EXDOS ask it.

Ah, that will be it. My 4kb RAM segment is mapped to the first page of the flash at the moment so SDEXT is at 40 and EXDOS at 41-42. I'll switch this around so EXDOS is at 40-41 and SDEXT at 42...

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
Re: SD extension
« Reply #8 on: 2014.May.13. 19:48:07 »
Ok, getting closer. I moved the ROM locations around and wrote the CID and OCR parts of the DISKIO_CTRL, now I get: "Disk operation aborted" when I do :dir f:

Any ideas on what this might be Zozo, before I start checking everything... :)

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 29.0 Firefox 29.0
    • View Profile
    • http://enterprise.iko.hu/
Re: SD extension
« Reply #9 on: 2014.May.13. 20:32:24 »
Your SD DISKIO send back error bits? If no then for quick try add XOR A at the end (no error).
Currently these not checked, A returned directly to EXDOS :oops:

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 29.0 Firefox 29.0
    • View Profile
    • http://enterprise.iko.hu/
Re: SD extension
« Reply #10 on: 2014.May.13. 20:42:26 »
SD errors:
SD_NOINIT    db 001h ;card not initialised
SD_VERIFY    db 002h ;verify error
SD_LOSTDATA    db 004h ;data lost during transfer
SD_DSKCHNG    008h ;disk changed
SD_NORECORD    010h ;sector not found
SD_NODISK    020h ;card not inserted
SD_WRPROT    040h ;card write protected
SD_UNKNOWN    080h ;unknow, currently not definied error

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
Re: SD extension
« Reply #11 on: 2014.May.13. 21:20:18 »
Thanks! I saw that a=0 was no error, but wasn't sure about the flags, as you say they were not checked by your driver, so I have just been returning 0 or FF. I'll look at returning the correct flags for the functions.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13340
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 29.0 Firefox 29.0
    • View Profile
    • http://enterprise.iko.hu/
Re: SD extension
« Reply #12 on: 2014.May.13. 21:30:15 »
Currently you see directly the returned values (for debugging reason), for example *** Error 64 when the card write protected.
In the next version will be translated these to correct EXDOS/EXOS error numbers, and display the right messages.

Offline Saint

  • EP user
  • *
  • Posts: 266
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 34.0.1847.131 Chrome 34.0.1847.131
    • View Profile
Re: SD extension
« Reply #13 on: 2014.May.13. 23:00:56 »
Ok, I had forgotten to save some registers in one of my functions and it was making it return an error, it's now working! :)

I will now be playing some games...