02 02 Operating System Services P2 — Transcript
Full transcript
- 0:08[Music]
- 0:20okay
- 0:21next system calls
- 0:23so system calls provide a means for a
- 0:26user or application programs to call
- 0:28upon the services provided by the
- 0:30operating systems from the previous
- 0:32slides okay
- 0:34so every time a user or a program
- 0:38needs services coming from the operating
- 0:40systems like program execution
- 0:42communication etc
- 0:44they are just using a system call so
- 0:47it's just like we are calling a function
- 0:50of an operating system so that we can
- 0:52use it
- 0:56all right so mostly accessed by programs
- 1:00by a high-level application programming
- 1:02interface or api
- 1:04rather than direct system called use
- 1:07okay
- 1:08so three most common apis are the win32
- 1:11api for windows pho 6 api for posix
- 1:15based systems including unix and linux
- 1:18and mac os and java api
- 1:21for java virtual machine or jvm
- 1:24okay
- 1:28okay so next this is our example or this
- 1:30is an example of a system call
- 1:33okay
- 1:34so generally written in c or c plus plus
- 1:37although some are written in assembly
- 1:39for optimal performance
- 1:40okay so this figure illustrates the
- 1:43sequence of system calls all right so
- 1:45these are the system calls here
- 1:50okay so this requires to copy a file
- 1:54okay
- 1:56so you can use strass
- 1:58or stress
- 1:59to see more examples of a large number
- 2:01of system calls invoked by a single
- 2:04simple command
- 2:06so read the man page for strays
- 2:09and try some simple examples
- 2:12strays mkdir
- 2:14temp stray cd temp stress date
- 2:17okay and so on
- 2:20so basically
- 2:21with this one the system call sequence
- 2:23to copy the contents
- 2:25of one file to another so source file
- 2:28could be
- 2:29a dot cpp that java but this one is of
- 2:32course that's what i've said earlier
- 2:34it's in crc plus okay
- 2:36and then
- 2:38of course that would be converted or
- 2:40translated into a destination file which
- 2:43okay
- 2:44mostly
- 2:46this file
- 2:47is basically
- 2:50an executable or
- 2:54okay any other forms or in this case
- 2:58the source file
- 2:59okay
- 3:00and the destination file would be the
- 3:03the other file okay or the copy of the
- 3:05other file
- 3:07all right
- 3:10next
- 3:11example of standard api so most
- 3:14programmers do not use the low level
- 3:16system calls directly but instead use
- 3:19an api
- 3:21or
- 3:22the application programming interface
- 3:25okay
- 3:27so the following sidebar shows read
- 3:30call available in the api or unix-based
- 3:34systems
- 3:35okay
- 3:39next system call implementation so
- 3:41typically
- 3:42a number is associated with each system
- 3:44call okay the system call interface
- 3:47maintains a table indexed according to
- 3:49these numbers
- 3:51and this system call interface invokes
- 3:54the intended system called an os kernel
- 3:57and return status of the system call and
- 4:00any return values
- 4:03okay so the caller needs to know nothing
- 4:06about how the system call is implemented
- 4:09so basically if you are a programmer we
- 4:10don't care about how the system call was
- 4:13implemented
- 4:14we simply call it and use it that's it
- 4:17okay so just needs to obey the api and
- 4:20understand the os will do us
- 4:24a result call
- 4:26so most details of the os interface
- 4:28hidden from the programmer by the api
- 4:31so managed by runtime support library
- 4:34these are the set of functions built
- 4:36into a libraries including with the
- 4:37compiler
- 4:39okay
- 4:41so
- 4:42the use of api instead of indirect
- 4:44system calls provides for greater
- 4:46program portability between different
- 4:48systems
- 4:51the api then makes the appropriate
- 4:53system calls
- 4:54through the system called interface
- 4:56using a table lookup to access a
- 4:59specific number of system calls as shown
- 5:01here in the figure
- 5:04alright
- 5:07next
- 5:08system called parameter passing
- 5:10so often
- 5:12more information is required than simply
- 5:15identity
- 5:16of the research system call
- 5:18so the general methods used to pass
- 5:20parameters to the os the simplest is
- 5:23pass the parameters in registers
- 5:26right or parameters is stored in block
- 5:28or table in memory
- 5:30and address of block passed as parameter
- 5:33in a register so this approach is taken
- 5:35by linux and solaris okay
- 5:39so
- 5:39also parameters placed or pushed onto
- 5:43the stock by the program and popped off
- 5:45the stock by the operating systems
- 5:48we'll be covering this okay in
- 5:50the latter chapters and discussions so
- 5:54black and stock methods do not limit the
- 5:56number over length
- 5:58of parameters being passed
- 6:02okay
- 6:03so this one is parameter passing by a
- 6:05table okay parameters are generally
- 6:07passed to system calls via registers or
- 6:10less commonly by values pushed onto the
- 6:13stock
- 6:14so large blocks of data are generally
- 6:17accessed indirectly
- 6:19through a memory address passed in
- 6:21register
- 6:22or
- 6:24on the stack as shown here
- 6:26okay
- 6:29all right
- 6:31so next would be a types of system calls
- 6:33so basically we have six major
- 6:35categories outlined on this fireprint
- 6:36presentation and we are going to start
- 6:38with process control
- 6:40so under process control okay so this
- 6:43process controls allows the following
- 6:45activities or access so create process
- 6:48terminate process and the board okay
- 6:51load execute and so on
- 6:53so that's one okay so as adam said there
- 6:56are six major categories of the system
- 6:58calls so first is
- 7:00process control
- 7:02second is file management so it allows
- 7:04us to create file delete file close or
- 7:07open file
- 7:08read write reposition
- 7:10get and set file attributes okay that is
- 7:13under file management second third
- 7:17you've got device management
- 7:19so under device management system calls
- 7:21so the users can request device release
- 7:24device read write reposition and so on
- 7:28okay
- 7:29next is
- 7:32information maintenance all right so
- 7:35under information maintenance you've got
- 7:36get time date set time or date okay so
- 7:40take note that we can do
- 7:42changing of time and date on our
- 7:44computer systems and we're just calling
- 7:46the information maintenance system calls
- 7:49all right
- 7:50communication system calls create delete
- 7:52communication connections
- 7:54okay so send receive messages if message
- 7:57passing model the host name or process
- 8:00name
- 8:01or from client to server and vice versa
- 8:04all right so if the applications is
- 8:07capable of communicating with the
- 8:09outside world all right so that means
- 8:13we are using this communication system
- 8:15calls
- 8:16all right
- 8:17and the last one is protection so
- 8:20control access to resources
- 8:22okay authorization
- 8:24get and set permissions allow internet
- 8:26user access okay so basically under
- 8:28protection system calls it the uh it
- 8:32tackles more on the authorization
- 8:35okay
- 8:36and authentication
- 8:38also all right so
- 8:41these were the six categories of system
- 8:44calls mentioned earlier process file
- 8:47device information communication and
- 8:49protection
- 8:50okay and this table here summarizes okay
- 8:54it shows the comparison
- 8:56okay or similarities of the areas of
- 8:59windows and unix system calls
- 9:01all right so in windows when we create
- 9:04process in the unix we call it fork okay
- 9:07creating a process means fork in unix
- 9:09exit process is also exit okay
- 9:14waiting for single object is wait here
- 9:17okay
- 9:19so
- 9:20these are examples of windows and unix
- 9:22system calls
- 9:24all right
- 9:26next
- 9:27standard c library example
- 9:30so take note that
- 9:32when we are doing our first program okay
- 9:35hello world
- 9:36in
- 9:37c or c plus plus okay so we often use
- 9:40this
- 9:42sharp include stdio so this article
- 9:44library or directives all right
- 9:48so
- 9:49standard library calls
- 9:51may also generate system calls as shown
- 9:53here
- 9:54all right so as shown in c or any
- 9:57programming language we are using a
- 9:59system called stair
- 10:01so c program invoking printf library
- 10:04call
- 10:05which calls write system call so that
- 10:07means printf we want to print something
- 10:09on the screen so we are calling
- 10:12a write system call there
- 10:15all right
- 10:18okay
- 10:18so next would be
- 10:20arduino so iot is getting popularity and
- 10:25basically this arduino is single tasking
- 10:29there is no operating systems on it all
- 10:32right so programs
- 10:34okay named sketch is loaded via usb
- 10:38into a flash memory
- 10:40so single memory space
- 10:41bootloader loads program and then
- 10:44program exit shell reloaded okay
- 10:48so
- 10:49this is how it looked like basically at
- 10:51system startup you have the bootloader
- 10:53and then you've got a free memory there
- 10:55okay so when you run the program okay so
- 10:58we copy the user program or the sketch
- 11:01on the free memory
- 11:02and then that's it
- 11:04again in arduino
- 11:06no operating systems on it
- 11:08all right
- 11:10all right so next is freebsd so freebsd
- 11:13is a unix variant just like linux
- 11:16okay
- 11:17so it is multitasking
- 11:19user can login invoke user's choice of
- 11:22shell okay shell is the cli of a unix
- 11:26based systems all right so shell
- 11:28executes fork
- 11:30fork meaning we are going to create a
- 11:32process from the table presented earlier
- 11:34okay
- 11:36so processes or process exits when
- 11:39code equals zero that means no error our
- 11:42code is greater than zero that means
- 11:44there is an error code
- 11:47all right
- 11:49next
- 11:50system services
- 11:52so system programs provide os
- 11:55functionality
- 11:57through separate applications which are
- 11:59not part of the kernel or the command
- 12:01interpreters
- 12:02okay so system programs provide a
- 12:04convenient environment
- 12:06for program development and execution so
- 12:09they can be divided into this
- 12:11all right so most users
- 12:14view
- 12:15of the operating system or operation of
- 12:17the system is defined by the system
- 12:18programs
- 12:19not the actual system calls
- 12:23okay
- 12:25next system services continuation we've
- 12:28got file management so this basically
- 12:32detailed okay this file manipulation
- 12:34status informations and so on on the
- 12:36next slide here so they are also known
- 12:39as system utilities or system
- 12:40applications
- 12:42so most system
- 12:43also ship with useful applications such
- 12:46as calculators all right or simple
- 12:48editors like notepad
- 12:50so some debate arises
- 12:52to a border between system and
- 12:54non-system applications all right
- 12:57so
- 12:59system programs may be divided into this
- 13:01categories okay so you've got file
- 13:04management
- 13:05programs to create
- 13:07delete
- 13:08copy rename
- 13:09print list and generally manipulate file
- 13:12and directories
- 13:14right you also have the status
- 13:16information
- 13:17utilities to check on the date time
- 13:21number of users
- 13:23process is running like what i've shown
- 13:25earlier
- 13:26using the task manager
- 13:28data logging etc so system registers are
- 13:31used to store and recall configuration
- 13:34information
- 13:36for particular applications
- 13:39all right
- 13:40so next is
- 13:42file modification
- 13:44for example text editors and other tools
- 13:46which can change file content so we call
- 13:49it file modification
- 13:51all right programming language support
- 13:54example compilers linkers debuggers
- 13:57providers assemblers
- 13:59so library achieve or archive management
- 14:03okay
- 14:04interpreters for common languages and
- 14:06support from it
- 14:09okay
- 14:10so next is communications
- 14:13programs for providing connectivity
- 14:15between
- 14:17processes or
- 14:18again when you process this our program
- 14:20and execution or running program
- 14:22and the users so including mail web
- 14:25browsers remote logins file transfers
- 14:29okay and remote command execution so
- 14:31that's
- 14:32under communications
- 14:35all right
- 14:37next background services
- 14:40so system demons are commonly started
- 14:43when the system is booted
- 14:45and run
- 14:46for as long as the system is running so
- 14:49handling necessary services
- 14:51examples include network demons
- 14:54print servers
- 14:56process schedulers and system error
- 14:58monitoring services
- 15:01all right
- 15:03and the last one is application programs
- 15:05so don't pertain to system
- 15:07okay so once the application programs
- 15:09these are run by the users
- 15:12not typically considered part of the
- 15:14operating systems
- 15:16okay
- 15:18all right so next is linkers and loaders
- 15:22all right
- 15:23so source code compiled into an object
- 15:26files designed to be loaded into the
- 15:28physical or any physical memory location
- 15:30so we look at a relocatable
- 15:33object file
- 15:34it's just like when we created our first
- 15:36program in c plus plus okay so basically
- 15:39what we see on the screen is our source
- 15:40code all right and that source code is
- 15:43usually in that cpp format
- 15:46okay
- 15:48so
- 15:49this source code when we compile it well
- 15:52that generates an object file
- 15:54okay
- 15:56so linker
- 16:00linker combines this into a single
- 16:02binary executable file
- 16:05also brings in libraries so program
- 16:07resides on the secondary storage as
- 16:09binary executable must be brought into
- 16:12the memory by a loader to be executed
- 16:16okay
- 16:17so relocation assigns final address
- 16:20to program parts and adjusts code and
- 16:23data in program to match those addresses
- 16:28so modern general purpose systems don't
- 16:30link libraries into executables rather
- 16:33dynamically link libraries or dll so
- 16:36that is what we use in windows are
- 16:38loaded as needed
- 16:39shared by all those that use the same
- 16:41version
- 16:42of that same library
- 16:44okay
- 16:45so object executable files have standard
- 16:48formats so operating system knows how to
- 16:51load and start them
- 16:53okay
- 16:54so
- 16:55if you will observe in
- 16:58c plus plus not during our early days in
- 16:59programming okay so once we created a
- 17:02program let's say that cpp okay so we
- 17:05usually compile it okay so with a
- 17:08successful compiling okay meaning no
- 17:11errors
- 17:12so that generates an object file
- 17:15okay that object file when we run that
- 17:18program
- 17:19okay
- 17:20and
- 17:21that object file
- 17:23is executed
- 17:24so we can see an output on the screen
- 17:27all right
- 17:28so
- 17:29that's what we do
- 17:31during our early days in programming so
- 17:33you that uses linkers and loaders okay
- 17:36so compilers are used for high-level
- 17:38language programming
- 17:40and at low level
- 17:42instead of compilers we use assembler
- 17:45okay so compiler high level programming
- 17:48assemblers low level programming
- 17:51okay
- 17:52so what is the role of the linker in the
- 17:54loader so for example this is what i'm
- 17:56i'm talking earlier
- 17:57okay so for example you have the source
- 17:59program
- 18:00main.c or main.cpp okay so when we
- 18:03compiled it
- 18:04it creates an object file
- 18:06okay
- 18:08so next is
- 18:12when
- 18:13we load it
- 18:15okay so the linker
- 18:16with other object files associated with
- 18:18that
- 18:19will generate an executable file okay so
- 18:22that's the linker there so compiler
- 18:24linker
- 18:25so compiler from source to object file
- 18:29from object file to executable file
- 18:31linker
- 18:32and if there are other object files
- 18:34there so that would be linked up also
- 18:37okay and an executable file to be loaded
- 18:40onto the ram for execution
- 18:43and calling other dynamically linked
- 18:45libraries or dll so that is where loader
- 18:47comes in
- 18:49okay so basically we don't care about
- 18:51this during our early days in
- 18:52programming all right so what we want to
- 18:55see there is just our code our program
- 18:57is successfully running
- 19:00all right
- 19:10[Music]
- 19:18you
About this transcript
This page contains the full transcript of 02 02 Operating System Services P2 by Santelmo, generated from the public captions YouTube serves with the video. The transcript has 2,331 words across 495 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.