Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Execute in place

From Wikipedia, the free encyclopedia
Computer science concept
"XIP" redirects here. For other uses, seeXIP (disambiguation).
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Execute in place" – news ·newspapers ·books ·scholar ·JSTOR
(August 2009) (Learn how and when to remove this message)

Incomputer science,execute in place (XIP) is a method of executing programs directly from long-term storage rather than copying it intoRAM. It is an extension of usingshared memory to reduce the total amount of memory required.

Its general effect is that the program text consumes no writable memory, saving it for dynamic data, and that all instances of the program are run from a single copy.

For this to work, several criteria have to be met:

  • The storage must provide a similar interface to theCPU as regular memory (or an adaptive layer must be present).
  • This interface must provide sufficiently fast read operations with arandom access pattern.
  • Thefile system, if one is used, needs to expose appropriate mapping functions.
  • The program must either belinked to be aware of the address the storage appears at in the system or beposition-independent.
  • The program must not modify data within the loaded image.

The storage requirements are usually met by usingNOR flash memory orEEPROM, which can be byte-addressed for read operations, although it is a bit slower than normal system RAM in most setups.

During boot

[edit]
See also:Booting

Inx86 systems, typically thefirst-stage bootloader is an XIP program that is linked to run at theaddress at which the flash chip(s) aremapped at power-up. It contains a minimal program to set up the system RAM (which depends on the components used on the individual boards and cannot be generalized enough so that the proper sequence could be embedded into the processor hardware) and then loads the second-stage bootloader or the OSkernel into RAM.

During this initialization, writable memory may not be available, so all computations have to be performed within the processor registers. For this reason, first stage boot loaders tend to be written in assembly language and only do the minimum to provide a normal execution environment for the next program. Some processors either embed a small amount of SRAM in the chip itself,[1] or allow using the onboard cache memory as RAM,[2] to make this first stage boot loader easier to write using high-level language.

For a kernel or bootloader,address space generally is assigned internally, so in order to use XIP for them, it is sufficient to instruct the linker to place unmodifiable and modifiable data in different address ranges and provide a mechanism for the modifiable data to be copied to writable memory before any code is run that assumes that data can be accessed normally. This can be done as part of the previous stage, or within a small code segment at the beginning of the program.

If address space is assigned externally, such as in an application program that is run on a system that does not providevirtual memory, the compiler needs to access all modifiable data by adding an offset to a pointer to a private copy of the data area. In this case, the external loader is responsible for setting up the instance specific memory areas.

In x86 systems, typically theBIOS /UEFI ROM is mapped to a fixed memory space upon power-on,[3] and BIOS / UEFI in x86 systems use XIP to initialize themain memory. In ARM and RISC-V embedded systems, typically the SoC built-inboot ROM is mapped to a fixed memory space upon power-on, and the boot ROM can find and load an embedded bootloader such asDas U-Boot fromNAND flash memory, and that boot process does not use a dedicatedEEPROM chip.

XIP as file system

[edit]

XIP places requirements on file systems that are often difficult to meet. In systems without apage table, the entire file must be stored within consecutive bytes and must not be fragmented, while flash based file systems often aim to distribute data into sectors of the flash chip that have the least erase cycles andeven out the wear on the chip, prolonging its lifetime.

All these complications and the speed tradeoff mean that XIP is generally only used for first stage bootloaders or when RAM is in extremely short supply. In particular, second through fourth generation video game consoles connect theROM cartridge's address and data bus to that of the console,[4] which lets (for example) theAtari 2600 work with only the 128 bytes of RAM in itsjoystick interface IC.

A relatively new file system for Linux, calledAXFS (Advanced XIP File System), aims to overcome some of the shortcomings associated with XIP, especially in regard to the in-place execution ofuser-space applications. For example, it makes it possible to split up an executable binary file into "XIP regions", thus avoiding the restriction of fragmentation that was mentioned above.

ANetBSD implementation is also under development.[5]

See also

[edit]

References

[edit]
  1. ^Samsung S3C2416X have 64kB embedded SRAM available on the system bus
  2. ^Broadcom BCM2835 uses its Level 2 Cache as boot loader RAM before SDRAM is initialized
  3. ^"Dude, Where's My 4 Gigabytes of RAM?".Coding Horror. 2007-03-08. Retrieved2024-08-31.
  4. ^US patent 4485457, Richard K. Balaska, Robert L. Hunter, and Scott S. Robinson, "Memory system including RAM and page switchable ROM", issued 1984-11-27, assigned to CBS Inc. 
  5. ^Uebayashi, Masao (2010-04-05)."eXecute-In-Place (XIP) Support for NetBSD"(PDF).BSDCan.

External links

[edit]
Processes
Bootingfirmware
Types
Interfaces
Implementations
Hybrid firmware bootloader
Bootloaders
Implementations
Partition layouts
Partitions
Utilities
Software
Hardware
Network boot
ROM variants
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Execute_in_place&oldid=1336575391"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp