Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling asus/lg cache in KiBs instead of MiB? #160

Open
thegawin opened this issue Jun 3, 2024 · 5 comments
Open

Handling asus/lg cache in KiBs instead of MiB? #160

thegawin opened this issue Jun 3, 2024 · 5 comments

Comments

@thegawin
Copy link

thegawin commented Jun 3, 2024

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

@superg
Copy link
Owner

superg commented Jun 3, 2024

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

@thegawin
Copy link
Author

thegawin commented Jun 3, 2024

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.

@superg
Copy link
Owner

superg commented Jun 4, 2024

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.

@thegawin
Copy link
Author

thegawin commented Jun 4, 2024

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.

@superg
Copy link
Owner

superg commented Jun 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants