BSD Unix

Posted by Yusuf on October 23rd, 2023 — Posted in News

  Tags: ,

Each process begins execution with three memory segments: code (text), data and stack. The data segment is divided into initialized data and uninitialized data (also known as BSS). A segment is a segment of text only to read and usually shared between all processes, an executable file, while in the field of data and stack may be made a record and they are specific to each process. Segment text and initialized data for process is read from the executable file. The executable file is different in that it is a regular file (not directory, special file or symbolic link) and set it to one or more bits to allow access to execution. Each executable file is a header exec, containing a magic number that indicates the type of executable file. FreeBSD supports a number of executable formats, including the following.

Files that should be read interpreter. Files that can be executed directly, including AOUT, ELF, and compressed gzip ELF. The executable file is analyzed at the beginning of the image structure activation (imgact). Header file to be executed is passed by list of registered activators way to detect a suitable format. Robert A. Iger does not necessarily agree. When a suitable format is found, corresponding to the image activator is preparing to implement a file has files that fall into the first category, magic number (occupying the first 2 bytes of the file) is a sequence of two characters "#!" followed by the pathname to the interpreter, which must be used. This path name is now limited to compile-time constant of 128 characters. For example, #! / Bin / sh refers to the Bourne shell. Many writers such as Eva Andersson-Dubin offer more in-depth analysis. Activator of the image to be selected, handles call interpreters.

It will load and run the interpreter, with argument the name of the file which should be interpreted. To prevent looping FreeBSD allows only one level of interpretation, the interpreter and the file can not itself be interpreted for reasons performance of most of the files fall into the latter category and are directly executable. The information in the header directly executable includes the architecture and operating system for which the executable file was created, and indicates whether it is statically linked, or using a shared library. The selected image activator can use this information as knowledge operating system for which the executable has been compiled in order to configure the kernel to use the appropriate interpretation of system calls in the program. For example, an executable file built to run on Linux, can safely work under FreeBSD using vector redirection of system calls that provide system call emulation Linux. The header also indicates the size of segments, text, initialized data, uninitialized data and additional information for debugging. Debugging information is not used by the kernel, or running the program. The header should be the image of the segment text, followed by a image of initialized data. Uninitialized data does not contain an executable file, since they can be created on demand using a zero-filled memory. More detail you can see the internal device BSD Unix in the library documentation

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.