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
Patch (computing)
(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!
== Types == {{Anchor|SOURCE-DIFF}} === Binary patches === Patches for [[proprietary software]] are typically distributed as [[executable file]]s instead of [[source code]]. When executed these files load a program into memory which manages the installation of the patch code into the target program(s) on disk. Patches for other software are typically distributed as data files containing the patch code. These are read by a patch [[utility program]] which performs the installation. This utility modifies the target program's executable file—the program's [[machine code]]—typically by overwriting its bytes with bytes representing the new patch code. If the new code will fit in the space (number of bytes) occupied by the old code, it may be put in place by overwriting directly over the old code. This is called an inline patch. If the new code is bigger than the old code, the patch utility will append load record(s) containing the new code to the object file of the target program being patched. When the patched program is run, execution is directed to the new code with branch instructions (jumps or calls) patched over the place in the old code where the new code is needed. On early 8-bit microcomputers, for example the Radio Shack [[TRS-80]], the operating system includes a PATCH/CMD utility which accepts patch data from a text file and applies the fixes to the target program's executable binary file(s). The patch code must have place(s) in memory to be executed at runtime. Inline patches are no difficulty, but when additional memory space is needed the programmer must improvise. Naturally if the patch programmer is the one who first created the code to be patched, this is easier. Savvy programmers plan in advance for this need by reserving memory for later expansion, left unused when producing their final iteration. Other programmers not involved with the original implementation, seeking to incorporate changes at a later time, must find or make space for any additional bytes needed. The most fortunate possible circumstance for this is when the routine to be patched is a distinct module. In this case the patch programmer need merely adjust the pointers or length indicators that signal to other system components the space occupied by the module; he is then free to populate this memory space with his expanded patch code. If the routine to be patched does not exist as a distinct memory module, the programmer must find ways to shrink the routine to make enough room for the expanded patch code. Typical tactics include shortening code by finding more efficient sequences of instructions (or by redesigning with more efficient algorithms), compacting message strings and other data areas, externalizing program functions to mass storage (such as disk overlays), or removal of program features deemed less important than the changes to be installed with the patch. Small in-memory machine code patches can be manually applied with the system debug utility, such as [[CP/M]]'s DDT or [[MS-DOS]]'s DEBUG debuggers. Programmers working in interpreted [[BASIC]] often used the POKE command to alter the functionality of a system service routine or the interpreter itself. === Source code patches === Patches can also circulate in the form of source code modifications. In this case, the patches usually consist of textual differences between two source code files, called "[[diff]]s". These types of patches commonly come out of [[open-source software project]]s. In these cases, developers expect users to compile the new or changed files themselves. === Large patches === Because the word "patch" carries the connotation of a small fix, large fixes may use different nomenclature. Bulky patches or patches that significantly change a program may circulate as "[[service pack]]s" or as "software updates". [[Microsoft Windows NT]] and its successors (including [[Windows 2000]], [[Windows XP]], [[Windows Vista]] and [[Windows 7]]) use the "service pack" terminology.<ref>{{cite web | url = http://windows.microsoft.com/en-us/windows/service-packs-download#sptabs=win7 | title = Service Pack and Update Center | access-date = 2015-06-01 | website = windows.microsoft.com | archive-date = 2015-06-01 | archive-url = https://web.archive.org/web/20150601154704/http://windows.microsoft.com/en-us/windows/service-packs-download#sptabs=win7 | url-status = live }}</ref> Historically, [[IBM]] used the terms "FixPaks" and "Corrective Service Diskette" to refer to these updates.<ref>{{cite web|url=http://www.tavi.co.uk/os2pages/glossary.html|title=Glossary of terms|website=www.tavi.co.uk|access-date=2016-11-23|archive-date=2016-12-01|archive-url=https://web.archive.org/web/20161201090736/http://www.tavi.co.uk/os2pages/glossary.html|url-status=live}}</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)