Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

HOL ZIP filesystem continued

Hi

Back in july I was asking for help about the HOL fs. I was put on an other project for a whiele so I have not been working on it since.

Now I am back and the problem is still the same.

Use the link below to see the old thread.

http://www.niosforum.com/forum/index.php?a...act=st&f=2&t=42 (http://www.niosforum.com/forum/index.php?act=st&f=2&t=42)

I have tried reading the memory area with a debugger and compared it to the file that the ZIP filesystem contains.

Debugger :

50 4b 03 04 14 00 02 00 00 00 6a 66 ba 30 58 f9 PK........jf.0x

70 6c 60 6f 01 00 60 6f 01 00 0b 00 00 00 6c 6f pl'o.. o......lo

61 64 65 72 2e 73 72 65 63 53 30 31 35 30 30 30 ader.srecS015000

Hex editor (Org file):

53 30 31 35 30 30 30 30 34 44 35 34 34 31 34 32 S01500004D544142

As you see the debugger shows PK........jf.0xpl'o.. o......loader.srec before the memory begin to match the hex editors view.

Don't now what this is used for. But it seems that loader.srec which is my file is present in this part of the memory. Any ideas of how I can acces this file??? You can see my program code in the old thread.

Best regards

GreateWhite.DK

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Now it works.

    Remember a "\0" after your file then it works. Sux though that this is not mentioned in the exsample to the ROZIPFS
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    GreatWhite,

    I'm the developer who wrote this. I think I've spotted your problem, and it's obscure, but I need you to try something for me.

    First a bit of background which may be of use to others reading this post. The pre-amble before the name of your file system is the zip file format see http://www.pkware.com/company/standards/appnote/ (http://www.pkware.com/company/standards/appnote/), PK0304 is the start of a file header

    The Zip filing system checks that all filesystems are valid before it mounts a filing system. If it's not valid it will not mount and all calls to fopen will fail. Normally this is because the flash file is not programmed correctly (however I don't think that's the problem in your case). The way to debug this would be open your Nios Device Drivers project in the IDE and set a breakpoint in alt_ro_zipfs_check_valid and find where under here the error occurs, it shouldn't be too hard

    However in your specific case I notice that the file starts

    50 4b 03 04 14 00 02 00

    The last two bytes here 0x2 are the general purpose bit flag from the specification

    The set bit, bit one has the description

    Bit 1: If the compression method used was type 6,

    Imploding, then this bit, if set, indicates

    an 8K sliding dictionary was used. If clear,

    then a 4K sliding dictionary was used.

    I've never seen this before, so if you could try something for me, if you open up the file altera_ro_zipfs.c and go to line 205 try replacing if (flags) by

    if (flags & 0xFD), let me know if this works.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi rugbybloke

    Thx for your answer. Well the ROZIPFS works if I use the ZIP file created by the webserver exsample. But if I use a ZIP file creted with my total commander(ver 6.01) at compression = 0 it f**** up. I have tried debugging.

    What I found was that in the altera_ro_zipfs.c line 135 it reports that my version is = 20. So I think I better be looking for some other compression tool. Do Altera provide a compression tool???

    Regards

    GreateWhite.DK
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    No we don't provide a compression tool, however we created the zip files using winZip which you can download for free from www.winzip.com

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Sorry GreatWhite our validate_zip utility should have caught this, it currently only checks whether the file is compressed, I will fix this for our 1.1 release