Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fat binary
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Notes== {{Reflist|group="nb"|refs= <ref group="nb" name="NB_CP/M-86">This isn't a problem for CP/M-86 style executables under [[CP/M-86]], [[CP/M-86 Plus]], [[Personal CP/M-86]], [[S5-DOS]], [[Concurrent CP/M-86]], [[Concurrent DOS]], [[Concurrent DOS 286]], [[FlexOS]], [[Concurrent DOS 386]], [[DOS Plus]], [[Multiuser DOS]], [[System Manager (Datapac)|System Manager]] and [[REAL/32]] because they use the [[file extension]] [[CMD file (CP/M)|.CMD]] rather than [[.COM]] for these files. (The .CMD extension, however, is conflictive with the file extension for [[batchjob]]s written for the [[command line processor]] [[CMD.EXE]] under the [[OS/2]] and [[Windows NT]] operating system families.)</ref> <ref group="nb" name="NB_C9">On [[8088]]/[[8086]] processors, the [[opcode]] {{mono|C9h}} is an undocumented alias for {{mono|CBh}} ("RETF", popping CS:IP from the [[program stack|stack]]<!-- DOS pushes 0 on the stack before starting programs (so that a "RETN" C3h works), so if DOS would have also pushed the PSP segment on the stack this would even have worked on 8088/8086 processors as the processor would then fall into the INT 20h at the start of the PSP. However, it is easier to just discard executables starting with C9h. -->), whereas it decodes as "LEAVE" (set SP to BP and pop BP) on [[80188]]/[[80186]] and newer processors.<!-- http://www.os2museum.com/wp/undocumented-8086-opcodes/ --></ref> <ref group="nb" name="NB_NAMES">This problem could have been avoided by choosing non-conflicting [[file extension]]s, but, once introduced, these particular file names were retained from very early versions of [[MS-DOS]]/[[PC DOS]]<!-- 1.x/2.x --> for compatibility reasons with (third-party) tools hard-wired to expect these specific file names.</ref> <ref group="nb" name="NB_HIDDEN">This is the reason why these files have the ''hidden'' [[file attribute|attribute]] set, so that they are not listed by default, thereby reducing the risk of being invoked accidentally.</ref> <ref group="nb" name="NB_KEYBOARD.SYS">Other [[DOS]] files of this type are [[KEYBOARD.SYS]], a binary [[keyboard layout]] database file for the keyboard driver [[KEYB (DOS command)|KEYB]] under [[MS-DOS]] and [[PC DOS]], [[IO.SYS]] containing the [[DOS BIOS]] under MS-DOS, and [[MSDOS.SYS]], a text configuration file under [[Windows 95]]/[[MS-DOS 7.0]] and higher, but originally a binary system file containing the MS-DOS [[kernel (operating system)|kernel]]. However, MS-DOS and PC DOS do not provide crash-protected system files at all, and these file names are neither used nor needed in [[DR-DOS 7.02]] and higher, which otherwise does provide crash-protected system files.<!-- The only file not protected by this scheme under DR-DOS is the text configuration file [[CONFIG.SYS]]. --></ref> <ref group="nb" name="NB_RET">This works because a (suitable) [[return instruction]] can be used to [[program exit|exit program]]s under [[CP/M-80]], [[CP/M-86]] and [[DOS]], although the [[opcode]]s, exact conditions and underlying mechanisms differ: Under CP/M-80, programs can terminate (that is, [[warm boot]] into the [[BIOS (CP/M)|BIOS]]) by jumping to 0 in the [[zero page (CP/M)|zero page]], either directly with RST 0 ([[8080]]/[[8085]]/[[Z80]] opcode C7h), or by calling [[BDOS (CP/M)|BDOS]] function 0 through the [[CALL 5 (CP/M)|CALL 5]] interface. Alternatively, as the [[program stack|stack]] is prepared to hold a 0 [[return address (computing)|return address]] before passing control to a loaded program, they can, for as long as the stack is flat, also be exited by issuing a RET (opcode C9h) instruction, thereby falling into the terminating code at offset 0 in the zero page. Although DOS has a dedicated [[INT 20h]] interrupt as well as [[INT 21h]] [[application program interface|API]] sub-functions to terminate programs (which are preferable for more complicated programs), for [[source-to-source translator|machine-translated]] programs DOS also emulates CP/M's behaviour to some extent: A program can terminate itself by jumping to offset 0 in its [[Program Segment Prefix|PSP]] (the equivalent to CP/M's zero page), where the system had previously planted an INT 20h instruction. Also, a loaded program's initial stack is prepared to hold a word of 0, so that a program issuing a near return RETN ([[8088]]/[[8086]] opcode C3h) will implicitly jump to the start of its code segment as well, thereby eventually reaching the INT 20h as well.{{citeref|a|ref=CITEREF-Paul-2002-COM}} In CP/M-86, the zero page is structured differently and there is no CALL 5 interface, but the stack return method and BDOS function 0 (but now through [[INT E0h]]) both work as well.</ref> <ref group="nb" name="NB_COUNTRY.SYS">The <code>COUNTRY.SYS</code> file formats supported by the [[MS-DOS]]/[[PC DOS]] and the [[DR-DOS]] families of operating systems contain similar data but are organized differently and incompatible. Since the entry points into the data structures are at different offsets in the file it is possible to create "fat" <code>COUNTRY.SYS</code> databases, which could be used under both DOS families.{{citeref|b|ref=CITEREF-Paul-2001-COUNTRY}} However, [[DR-DOS 7.02]] and its [[NLSFUNC (DOS command)|NLSFUNC]] 4.00 (and higher) include an improved parser capable of reading both types of formats (and variants), even at the same time, so that [[Janus]]-headed files are not necessary.{{citeref|c|ref=CITEREF-Paul-1997-IBMBIO}}{{citeref|d|ref=CITEREF-Caldera-1998-DRDOS}} The shipped files are nevertheless "fat" for including a tiny executable stub just displaying an embedded message when invoked inappropriately.{{citeref|d|ref=CITEREF-Caldera-1998-DRDOS}}{{citeref|b|ref=CITEREF-Paul-2001-COUNTRY}}</ref> }}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)