CA Session 5 Summary - muneeb-mbytes/computerArchitectureCourse GitHub Wiki
System Call
A system call is a way for programs to interact with the operating system. A computer program makes a system call when it makes a request to the operating system's kernel. System call provides the services of the operating system to the user programs via Application Program Interface(API)
Why System Call
- While CPUs can handle basic tasks like arithmetic and memory access, more sophisticated functions like printing or reading keyboard inputs require additional software, including libraries and the operating system.
- CPUs enable interaction with the operating system through system calls.
- In the context of MIPS architecture, the system call instruction is employed to initiate these calls
- It is must require when a file system wants to create or delete a file.
- Network connections require the system calls to sending and receiving data packets
- If you want to read or write a file, you need system calls.
- If you want to access hardware devices, including a printer, scanner, you need a system call
- System calls are used to create and manage new processes.
Following are some of the available System Calls
Pseudorandomization:
It is a method for producing computer-generated random numbers that are identical to real random numbers.
What is pseudo random generator?
- The term "pseudo random number generator" (PRNG) describes an algorithm that generates random number sequences using mathematical formulas
- We can’t generate truly random numbers from deterministic thing like computer. So pseudorandom generator is required
- The initial value of ff when power is given and clock is zero is x (unknown)
- In this world nothing is random. pseudo means imaginary or false
- It requires an initial assumption which is known as seed
Difference between the random and pseudorandom numbers:
Types of pseudorandomization:
- $urandom() generates a 32-bit unsigned pseudorandom number each time it is called
- $random() generates a 32-bit signed pseudorandom number each time it is called
- $urandom_range(min, max) returns an unsigned pseudorandom number within the specified range
- std::randomize() allows for the randomization of multiple variables that are not class members within a specified scope
Pseudo Instructions:
- Pseudo-instructions are not real instructions which means that returns to make our life easy
- Every pseudo instruction translate into real instructions
- Assembler converts pseudo instruction to real instruction then to binary
- Pseudo instructions does not have corresponding hardware code the decoded instructions are converted into hardware
More about Pseudo Instructions
- Symbolic Representations Pseudo instructions are symbolic representations used in assembly language programming.
- Enhanced Readability They are employed to simplify coding and improve the readability of assembly language programs.
- Translation Pseudo instructions are not directly executed by the processor; instead, they are translated into one or more actual machine instructions by the assembler or compiler.
- Common Operations They often represent common operations or sequences of instructions that occur frequently in programming tasks.
- Streamlining Programming Pseudo instructions streamline programming tasks by providing shortcuts or higher-level abstractions for complex operations.
- Placeholder Functions Sometimes, pseudo instructions act as placeholders or markers for specific actions that need to be performed during the assembly or compilation process.
- Examples Pseudo instructions include "LOAD," "STORE," "MOVE," and "JUMP," which represent common memory access and control flow operations.