redumper icon indicating copy to clipboard operation
redumper copied to clipboard

Handling asus/lg cache in KiBs instead of MiB?

Open thegawin opened this issue 1 year ago • 5 comments

Not sure if super important, but I've noticed that:

  1. Some drives are using less than 1MiB (Those with MT1862 are interesting as they support scrabbled mode and are cheap dvd, but have low quality firmware.)
  2. JB8 boards have weird amount of cache (4064 kiB not 4096 kiB)

https://forum.cdrinfo.pl/attachments/f15/77911d1461421554-encyklopedia-hitachi-lg-hlds-hlds_table_v1.1.pdf

thegawin avatar Jun 03 '24 13:06 thegawin

Not immediately clear on what do you mean by handling exactly?

superg avatar Jun 03 '24 20:06 superg

This function: https://github.com/superg/redumper/blob/main/drive.ixx#L495

Basically with using MiB and integer, we cannot use values 0.512 or 4.064. I was wondering, if not matching real cache size can cause some problems.

thegawin avatar Jun 03 '24 23:06 thegawin

Hmm, the sizes from the table you linked (Buffer column) imply that flash still might be aligned to MiB as 4064 is very close to 4096 (4 MiB). My assumption is that hardware flash size can still be 4 MiB. I prefer not to trust some table from internets because I don't know how this data was acquired.

Overall, ASUS cache structure is complicated. There are 2 parts, part #1 is sectors cache, part #2 is the area that is allocated for internal drive use. If you look at the 2nd structure member in https://github.com/superg/redumper/blob/main/drive.ixx#L254 - this is number of sectors that drive buffers and that defines the size of the part #2. For the same flash size, there can be different "partition" schemes, for 8Mb cache for instance, there are 3 known schemes.

The table you linked might define part #1 but total cache size can still be aligned to Megabytes. Ideally, if you could get me a cache dump (redumper .asus file that gets generated when you dump using --drive-type=LG_ASU8A) - I could tell the partition and real cache size and if it's indeed in KiB - I will change that.

superg avatar Jun 04 '24 00:06 superg

You mean .scram file? With this argument I'm getting this:

LG/ASUS: searching lead-out in cache (LBA: 133457)            
error: read cache failed, SCSI (SC: CHECK CONDITION, SK: ILLEGAL REQUEST, ASC: INVALID FIELD IN CDB)

Edit: It's BW-16D1HT with ribshark's firmware. Edit2: But should be adaptable for all jb8 boards.

thegawin avatar Jun 04 '24 00:06 thegawin

As I've said, get me a cache dump from the drives where cache size is not multiple of MiB.

superg avatar Jun 04 '24 00:06 superg