Topic 8 – Processors and hardware Flashcards
regarding the items below how does each handle
porting to different computer hardware
- linux
- windows
this is handled:
- linux - follows a style as UNIX did and makes it easy to port to different architectures
- windows - is more limited and for most of its life has only ran on Intel chips or intel compatible chips
what is the
SYSCALL machine instruction
used for
this works in a similar manner to the CALL instruction however this will swith the processor mode to kernel mode.
this is typically used by any application that is running in user mode and would like to use hardware
example
an application wants to save a value to memory so uses the os API that handles that the API makes one of these to the appropriate OS module. the task is then carried out by the OS
this is achieved by the OS
it will save and restore the states of all of these upon each context switch
the values held in the registers is unique to every process
so how is multitasking achieved
the process for this is as follows:
- the main code makes a CALL to the subroutine A (CALL A)
- the address held in the instruction pointer register is transferred to the stack pointer register
- the address of subroutine A is put inside the instruction pointer register
- execution of subroutine A begins
- when subroutine A has finished execution it will use the RETURN machine instruction
- the address held in the stack pointer register is returned back to the instruction pointer register
- execution of the main code is resumed
describe the process of a programs main execution code using a CALL to the subroutine A and the subroutine using a RETURN to give control back to the main code
what is a
subroutine
this is simply a saved set of instructions in memory that can be called upon by any part of the program
what is an
interrupt service routine (ISR)
this is specific code that is held in the operating system and is called after a processor recives an interrupt request (IRQ) from hardware
one basic task this may carry out is collecting data from a keyboard or mouse
what are
functional components
this is any hardware on the system that the operating system must be aware of such as:
- processor
- ram
- display
- leds
- hard drive
in practice an operating system will only deal with major components such as a processor and the control and management of less major components is delegated to device drivers
this is a set of instructions held in a processor that can be used by applications and the operating system to perform actions such as
- arithmetic
- jumping to a memory address
- fetching and storing data
what is an
instruction set
what is
porting
this is the process of moving an application from one platform to another
one of the jobs of an operating sytem is to provide
hardware independence
how does it achieve this upon install of itself
when an operating system is installing itself it achieves this by detecting the hardware being used and selecting the correct components of itslef that will work with that hardware
This is a 64-bit instruction set, first defined by AMD and subsequently adopted by Intel. (Confusingly, Intel also define an IA-64 instruction set that is quite different but not widely used.)
(open university, 2020)
describe the instruction set
AMD64 (also referred to as x86-64 or Intel 64
what is a
subroutine variably known as
this may also be called a
- function
- procedure
- method
- routine
for each of the items below give its purpose:
- instruction pointer register
- general purpose registers
- stack pointer register
what registers are involved for each of the items below:
- Knowing where we are in execution
- Knowing what values are currently being evaluated or calculated
- What subroutines have been called
can subroutines call other subroutines
YES
this follow the same principle as if the main code was calling this. making use of:
- CALL instruction
- instruction pointer register
- stack pointer register
- RETURN instruction
this is used to hold the address held in the Instruction Pointer (IP) when a change in execution happens such as a CALL, SYSCALL or interrupt
the values are held in a stack following a last in first out model
the RETURN machine instruction is used to retrieve and restore the address from this back to the instruction pointer
what is the
Stack Pointer (SP)
used for
what is the
Stack Pointer (SP)
used for
this is used to hold the address held in the Instruction Pointer (IP) when a change in execution happens such as a CALL, SYSCALL or interrupt
the values are held in a stack following a last in first out model
the RETURN machine instruction is used to retrieve and restore the address from this back to the instruction pointer
this is a combinaion of
- the instruction set
- functional devices
what is
computer architecture
this is specific code that is held in the operating system and is called after a processor recives an interrupt request (IRQ) from hardware
one basic task this may carry out is collecting data from a keyboard or mouse
what is an
interrupt service routine (ISR)
what is the
CALL machine instruction
this is used by a programs main execution code and also subroutines of the program so that it can pause its own execution and make use of a subroutine
using the items below create two platforms
- linux operating sytem
- windows operating system
- AMD processor
- Intel processor
two platforms could be
platform 1
- linux opearting system
- AMD processor
platform 2
- windows operating system
- Intel processor
this is any hardware on the system that the operating system must be aware of such as:
- processor
- ram
- display
- leds
- hard drive
in practice an operating system will only deal with major components such as a processor and the control and management of less major components is delegated to device drivers
what are
functional components
the values held in the registers is unique to every process
so how is multitasking achieved
this is achieved by the OS
it will save and restore the states of all of these upon each context switch
these could be:
- x86 (also referred to as i386 or IA-32)
- AMD64 (also referred to as x86-64 or Intel 64
- ARM
name 3 different
instruction sets
what is a
central processing unit (CPU)
able to do and what
components will it contain
this is able to perform:
- any instructions it has hard coded
- arithemtic
- boolean comparisons
it will typically contain its own L1 and L2 cache and will share any higher levels of cache
why might a chip manufacturer include a compatibilty mode in there new processor
a chip manufacturer may decide to include this when they make radical changes such as going from 32 bit to 64 bit
the reason being that there would otherwise be no software that could amke use of the new processor and this is bad for any software developers as well as the chip manufacturer itself
what is a
benefit of subroutines
the benefit of these is that it is an efficient way of creating code when we know in advance it will be used repeatedly in various parts of a program
example
there could be a one of these to change a string from upppercase to lower case
describe the instruction set
AMD64 (also referred to as x86-64 or Intel 64
This is a 64-bit instruction set, first defined by AMD and subsequently adopted by Intel. (Confusingly, Intel also define an IA-64 instruction set that is quite different but not widely used.)
(open university, 2020)