Talk:Amiga Hunk

Some operating systems, such as MS-DOS or Windows, need filename extensions to recognize that a file is an executable.

This is plainly wrong. Even in MS-DOS extension was required only by OS shell, COMMAND.COM, OS itself used extension in launching code only once -- in a check whether the file is an OS shell script. If it was so, that is, extension was "BAT", it called the shell to execute the script. In all other cases OS checked the binary signature in the beginning of the file, and if it was "MZ" it loaded the file as a relocatable binary, and if there was anything else -- as a simple, non-relocatabe image. --Khathi (talk) 15:45, 19 January 2008 (UTC)

.info files
Strictly speaking, .info files are only created if a program specifies to. A file may have no .info, in which case it does not appear in Workbench unless "View All Files" is enabled. --Jonathan Drain (talk) 06:49, 20 August 2008 (UTC)

Invalid section?
The section "Structure of an Amiga executable file" could be wrong or not clear enough. I'm disassembling an old Atari ST game originally coded on the Amiga and just found out what this strange header represent - An Amiga exec header. When I compare the "Structure of an Amiga executable file" section of this article with what I have, it doesn't work. This is my header:

000003F3                          ; HUNK_HEADER 00000000 00000001 00000000 00000000 00005F84 000003E9                          ; HUNK_CODE 00005F84

The article says "In the beginning of the file there is the magic cookie, then is declared the total number of hunks in the executable". Considering the next number after HUNK_HEADER is 0, this doesn't work. -- Lyverbe (talk) 15:36, 23 December 2009 (UTC)

Very unclear chapter.
"Even if this solution for identifying executable files is still in use in Unix, Unix-like systems have nowadays adopted a different system. The new system deals with file attribute bits and consists of setting the attribute bit "X" (stands for "eXecutable") in the table of attribute bits of the structure of the file itself."

This first tells that Unix uses magic cookies, then in the next sentence tells that Unix has adopted a different system. This doesn't make any sense to me, although I'm not a native English speaker. And attribute bit "x" has been in Unix from the start as well, it is definitely not something that would have been adopted later. If, in Unix, "x" bit is set and file starts with #! then it is considered a script, if it has a certain magic number in the beginning it is considered to be a binary executable. I will fix this - my first Wikipedia edit.

Comment after edit: it was much harder to explain this subject precisely than I thought.. improvements are definitely welcome. I also changed "X" to "x" as Unix is case-sensitive and always uses lowercase when referring to file attribute bits. And speaking of MS-DOS, IIRC .com files do not have any header information and therefore no magic number in them (but .exe files do), therefore this extension has to be checked as well. Someone who uses Windows or MS-DOS could try to rename a small .txt file to .com and try to execute in DOS prompt and it should crash, confirming my theory.

Jviherakoski (talk) 04:32, 19 July 2010 (UTC)

General
This article has lots of syntax and grammar errors, is difficult to read and understand, and has also lots of mistakes. I have partially fixed the Icons section, but the whole page would probably need a rewrite. — Preceding unsigned comment added by Cunin (talk • contribs) 23:21, 31 July 2011 (UTC)
 * It is ok but I wonder why this information is here? What icons have to do with hunk formats? Xorxos (talk) 18:08, 1 August 2011 (UTC)

I think it might be useful to introduce how Amiga handles executable files, how are they run, and how to set things such as stacksize and options. But yeah, maybe linking to specific pages that already explains such subjects in details could make the whole page smaller and more readable. Actually I just registered to fix what's written on pages, not to completely restructure them, so I'll let someone else decide upon this.--Cunin (talk) 16:54, 3 August 2011 (UTC)

I appreciate the work that's been done on the page, but I do think there's a lot of stuff, such as that highlighted above, that really needs to be moved out of the article, and other issues need to be clarified or even added. Some things that spring to mind:

* Hunk files are used for all files containing 68000 code, not just what would normally be termed "executables" (normally a term reserved for programs directly invokable by a user from a graphical or command line shell): device drivers (.device and .handler), and libraries are two examples of files that aren't "executable" but would be hunked. * The article on how executables are identified spends more time talking about DOS and Unix than it does AmigaOS * Ironically, the AmigaOS bit actually misses out information - talking about the +x metadata flag on Unix without talking about the equivalent s and e flags in AmigaOS (not to mention h) (indeed, reading the article you'd think you don't need to set either for an executable.) * .info files are talked about at length, but while they should be talked about somewhere, this is clearly the wrong article. This article is about the hunk format, not about how AmigaOS stores additional metadata. .info concepts apply to virtually all types of files, not just hunk files, and many common hunk file types are noted for their lack of a ,info file. * The fact hunk files had various different types is mentioned at length... except why there was a need for them to begin with! Two major issues that hunk files addressed were the memory type requirements of AmigaOS applications (some data needed to be loaded into chip RAM, a type of slow DMA-enabled memory built into every Amiga, and some didn't have that requirement and optimal running of the application meant loading it elsewhere was prefered.); and the "one memory space" characteristic of Amiga memory which meant that as applications were loaded and unloaded, the largest continuous block of RAM that could be allocated would shrink because of memory fragmentation. Using hunks directly addressed the former, and could be used to overcome the latter by allowing applications to be loaded into small blocks across the system. * Hunk files also contained disadvantages, again not addressed by the article. While small hunks may overcome the problems of loading an application into a fragmented system, they also made fragmentation worse. In the days of 880k floppies, a common complaint was that overly hunked executables took up far more disk space than more optimally put together executables.

I also wonder if it might be worth including a brief mention of PowerPacker (and crunchers in general) which used a variety of techniques - manipulating the hunk system in the process - to reduce the size of executables? --98.254.202.225 (talk) 13:50, 21 April 2012 (UTC)

Amiga Hunk format was not invented by Commodore; it has its roots with Tripos
Please see http://www.pagetable.com/?p=193.

I was considering making edits to this page to reflect this information, but the last contribution I made to Wikipedia got resoundingly shot down, and I gave up in disgust.

So, I'll leave it to a more socially acceptable editor to review the evidence and update the page as appropriate. Kc5tja (talk) 20:32, 30 January 2018 (UTC)


 * Done, thanks. Aeroid (talk) 10:54, 25 June 2023 (UTC)