YouTube2Text

02 02 Operating System Services P2 — Transcript

by Santelmo · 2,331 words · 495 segments · language en · Watch on YouTube

Full transcript

  1. 0:08[Music]
  2. 0:20okay
  3. 0:21next system calls
  4. 0:23so system calls provide a means for a
  5. 0:26user or application programs to call
  6. 0:28upon the services provided by the
  7. 0:30operating systems from the previous
  8. 0:32slides okay
  9. 0:34so every time a user or a program
  10. 0:38needs services coming from the operating
  11. 0:40systems like program execution
  12. 0:42communication etc
  13. 0:44they are just using a system call so
  14. 0:47it's just like we are calling a function
  15. 0:50of an operating system so that we can
  16. 0:52use it
  17. 0:56all right so mostly accessed by programs
  18. 1:00by a high-level application programming
  19. 1:02interface or api
  20. 1:04rather than direct system called use
  21. 1:07okay
  22. 1:08so three most common apis are the win32
  23. 1:11api for windows pho 6 api for posix
  24. 1:15based systems including unix and linux
  25. 1:18and mac os and java api
  26. 1:21for java virtual machine or jvm
  27. 1:24okay
  28. 1:28okay so next this is our example or this
  29. 1:30is an example of a system call
  30. 1:33okay
  31. 1:34so generally written in c or c plus plus
  32. 1:37although some are written in assembly
  33. 1:39for optimal performance
  34. 1:40okay so this figure illustrates the
  35. 1:43sequence of system calls all right so
  36. 1:45these are the system calls here
  37. 1:50okay so this requires to copy a file
  38. 1:54okay
  39. 1:56so you can use strass
  40. 1:58or stress
  41. 1:59to see more examples of a large number
  42. 2:01of system calls invoked by a single
  43. 2:04simple command
  44. 2:06so read the man page for strays
  45. 2:09and try some simple examples
  46. 2:12strays mkdir
  47. 2:14temp stray cd temp stress date
  48. 2:17okay and so on
  49. 2:20so basically
  50. 2:21with this one the system call sequence
  51. 2:23to copy the contents
  52. 2:25of one file to another so source file
  53. 2:28could be
  54. 2:29a dot cpp that java but this one is of
  55. 2:32course that's what i've said earlier
  56. 2:34it's in crc plus okay
  57. 2:36and then
  58. 2:38of course that would be converted or
  59. 2:40translated into a destination file which
  60. 2:43okay
  61. 2:44mostly
  62. 2:46this file
  63. 2:47is basically
  64. 2:50an executable or
  65. 2:54okay any other forms or in this case
  66. 2:58the source file
  67. 2:59okay
  68. 3:00and the destination file would be the
  69. 3:03the other file okay or the copy of the
  70. 3:05other file
  71. 3:07all right
  72. 3:10next
  73. 3:11example of standard api so most
  74. 3:14programmers do not use the low level
  75. 3:16system calls directly but instead use
  76. 3:19an api
  77. 3:21or
  78. 3:22the application programming interface
  79. 3:25okay
  80. 3:27so the following sidebar shows read
  81. 3:30call available in the api or unix-based
  82. 3:34systems
  83. 3:35okay
  84. 3:39next system call implementation so
  85. 3:41typically
  86. 3:42a number is associated with each system
  87. 3:44call okay the system call interface
  88. 3:47maintains a table indexed according to
  89. 3:49these numbers
  90. 3:51and this system call interface invokes
  91. 3:54the intended system called an os kernel
  92. 3:57and return status of the system call and
  93. 4:00any return values
  94. 4:03okay so the caller needs to know nothing
  95. 4:06about how the system call is implemented
  96. 4:09so basically if you are a programmer we
  97. 4:10don't care about how the system call was
  98. 4:13implemented
  99. 4:14we simply call it and use it that's it
  100. 4:17okay so just needs to obey the api and
  101. 4:20understand the os will do us
  102. 4:24a result call
  103. 4:26so most details of the os interface
  104. 4:28hidden from the programmer by the api
  105. 4:31so managed by runtime support library
  106. 4:34these are the set of functions built
  107. 4:36into a libraries including with the
  108. 4:37compiler
  109. 4:39okay
  110. 4:41so
  111. 4:42the use of api instead of indirect
  112. 4:44system calls provides for greater
  113. 4:46program portability between different
  114. 4:48systems
  115. 4:51the api then makes the appropriate
  116. 4:53system calls
  117. 4:54through the system called interface
  118. 4:56using a table lookup to access a
  119. 4:59specific number of system calls as shown
  120. 5:01here in the figure
  121. 5:04alright
  122. 5:07next
  123. 5:08system called parameter passing
  124. 5:10so often
  125. 5:12more information is required than simply
  126. 5:15identity
  127. 5:16of the research system call
  128. 5:18so the general methods used to pass
  129. 5:20parameters to the os the simplest is
  130. 5:23pass the parameters in registers
  131. 5:26right or parameters is stored in block
  132. 5:28or table in memory
  133. 5:30and address of block passed as parameter
  134. 5:33in a register so this approach is taken
  135. 5:35by linux and solaris okay
  136. 5:39so
  137. 5:39also parameters placed or pushed onto
  138. 5:43the stock by the program and popped off
  139. 5:45the stock by the operating systems
  140. 5:48we'll be covering this okay in
  141. 5:50the latter chapters and discussions so
  142. 5:54black and stock methods do not limit the
  143. 5:56number over length
  144. 5:58of parameters being passed
  145. 6:02okay
  146. 6:03so this one is parameter passing by a
  147. 6:05table okay parameters are generally
  148. 6:07passed to system calls via registers or
  149. 6:10less commonly by values pushed onto the
  150. 6:13stock
  151. 6:14so large blocks of data are generally
  152. 6:17accessed indirectly
  153. 6:19through a memory address passed in
  154. 6:21register
  155. 6:22or
  156. 6:24on the stack as shown here
  157. 6:26okay
  158. 6:29all right
  159. 6:31so next would be a types of system calls
  160. 6:33so basically we have six major
  161. 6:35categories outlined on this fireprint
  162. 6:36presentation and we are going to start
  163. 6:38with process control
  164. 6:40so under process control okay so this
  165. 6:43process controls allows the following
  166. 6:45activities or access so create process
  167. 6:48terminate process and the board okay
  168. 6:51load execute and so on
  169. 6:53so that's one okay so as adam said there
  170. 6:56are six major categories of the system
  171. 6:58calls so first is
  172. 7:00process control
  173. 7:02second is file management so it allows
  174. 7:04us to create file delete file close or
  175. 7:07open file
  176. 7:08read write reposition
  177. 7:10get and set file attributes okay that is
  178. 7:13under file management second third
  179. 7:17you've got device management
  180. 7:19so under device management system calls
  181. 7:21so the users can request device release
  182. 7:24device read write reposition and so on
  183. 7:28okay
  184. 7:29next is
  185. 7:32information maintenance all right so
  186. 7:35under information maintenance you've got
  187. 7:36get time date set time or date okay so
  188. 7:40take note that we can do
  189. 7:42changing of time and date on our
  190. 7:44computer systems and we're just calling
  191. 7:46the information maintenance system calls
  192. 7:49all right
  193. 7:50communication system calls create delete
  194. 7:52communication connections
  195. 7:54okay so send receive messages if message
  196. 7:57passing model the host name or process
  197. 8:00name
  198. 8:01or from client to server and vice versa
  199. 8:04all right so if the applications is
  200. 8:07capable of communicating with the
  201. 8:09outside world all right so that means
  202. 8:13we are using this communication system
  203. 8:15calls
  204. 8:16all right
  205. 8:17and the last one is protection so
  206. 8:20control access to resources
  207. 8:22okay authorization
  208. 8:24get and set permissions allow internet
  209. 8:26user access okay so basically under
  210. 8:28protection system calls it the uh it
  211. 8:32tackles more on the authorization
  212. 8:35okay
  213. 8:36and authentication
  214. 8:38also all right so
  215. 8:41these were the six categories of system
  216. 8:44calls mentioned earlier process file
  217. 8:47device information communication and
  218. 8:49protection
  219. 8:50okay and this table here summarizes okay
  220. 8:54it shows the comparison
  221. 8:56okay or similarities of the areas of
  222. 8:59windows and unix system calls
  223. 9:01all right so in windows when we create
  224. 9:04process in the unix we call it fork okay
  225. 9:07creating a process means fork in unix
  226. 9:09exit process is also exit okay
  227. 9:14waiting for single object is wait here
  228. 9:17okay
  229. 9:19so
  230. 9:20these are examples of windows and unix
  231. 9:22system calls
  232. 9:24all right
  233. 9:26next
  234. 9:27standard c library example
  235. 9:30so take note that
  236. 9:32when we are doing our first program okay
  237. 9:35hello world
  238. 9:36in
  239. 9:37c or c plus plus okay so we often use
  240. 9:40this
  241. 9:42sharp include stdio so this article
  242. 9:44library or directives all right
  243. 9:48so
  244. 9:49standard library calls
  245. 9:51may also generate system calls as shown
  246. 9:53here
  247. 9:54all right so as shown in c or any
  248. 9:57programming language we are using a
  249. 9:59system called stair
  250. 10:01so c program invoking printf library
  251. 10:04call
  252. 10:05which calls write system call so that
  253. 10:07means printf we want to print something
  254. 10:09on the screen so we are calling
  255. 10:12a write system call there
  256. 10:15all right
  257. 10:18okay
  258. 10:18so next would be
  259. 10:20arduino so iot is getting popularity and
  260. 10:25basically this arduino is single tasking
  261. 10:29there is no operating systems on it all
  262. 10:32right so programs
  263. 10:34okay named sketch is loaded via usb
  264. 10:38into a flash memory
  265. 10:40so single memory space
  266. 10:41bootloader loads program and then
  267. 10:44program exit shell reloaded okay
  268. 10:48so
  269. 10:49this is how it looked like basically at
  270. 10:51system startup you have the bootloader
  271. 10:53and then you've got a free memory there
  272. 10:55okay so when you run the program okay so
  273. 10:58we copy the user program or the sketch
  274. 11:01on the free memory
  275. 11:02and then that's it
  276. 11:04again in arduino
  277. 11:06no operating systems on it
  278. 11:08all right
  279. 11:10all right so next is freebsd so freebsd
  280. 11:13is a unix variant just like linux
  281. 11:16okay
  282. 11:17so it is multitasking
  283. 11:19user can login invoke user's choice of
  284. 11:22shell okay shell is the cli of a unix
  285. 11:26based systems all right so shell
  286. 11:28executes fork
  287. 11:30fork meaning we are going to create a
  288. 11:32process from the table presented earlier
  289. 11:34okay
  290. 11:36so processes or process exits when
  291. 11:39code equals zero that means no error our
  292. 11:42code is greater than zero that means
  293. 11:44there is an error code
  294. 11:47all right
  295. 11:49next
  296. 11:50system services
  297. 11:52so system programs provide os
  298. 11:55functionality
  299. 11:57through separate applications which are
  300. 11:59not part of the kernel or the command
  301. 12:01interpreters
  302. 12:02okay so system programs provide a
  303. 12:04convenient environment
  304. 12:06for program development and execution so
  305. 12:09they can be divided into this
  306. 12:11all right so most users
  307. 12:14view
  308. 12:15of the operating system or operation of
  309. 12:17the system is defined by the system
  310. 12:18programs
  311. 12:19not the actual system calls
  312. 12:23okay
  313. 12:25next system services continuation we've
  314. 12:28got file management so this basically
  315. 12:32detailed okay this file manipulation
  316. 12:34status informations and so on on the
  317. 12:36next slide here so they are also known
  318. 12:39as system utilities or system
  319. 12:40applications
  320. 12:42so most system
  321. 12:43also ship with useful applications such
  322. 12:46as calculators all right or simple
  323. 12:48editors like notepad
  324. 12:50so some debate arises
  325. 12:52to a border between system and
  326. 12:54non-system applications all right
  327. 12:57so
  328. 12:59system programs may be divided into this
  329. 13:01categories okay so you've got file
  330. 13:04management
  331. 13:05programs to create
  332. 13:07delete
  333. 13:08copy rename
  334. 13:09print list and generally manipulate file
  335. 13:12and directories
  336. 13:14right you also have the status
  337. 13:16information
  338. 13:17utilities to check on the date time
  339. 13:21number of users
  340. 13:23process is running like what i've shown
  341. 13:25earlier
  342. 13:26using the task manager
  343. 13:28data logging etc so system registers are
  344. 13:31used to store and recall configuration
  345. 13:34information
  346. 13:36for particular applications
  347. 13:39all right
  348. 13:40so next is
  349. 13:42file modification
  350. 13:44for example text editors and other tools
  351. 13:46which can change file content so we call
  352. 13:49it file modification
  353. 13:51all right programming language support
  354. 13:54example compilers linkers debuggers
  355. 13:57providers assemblers
  356. 13:59so library achieve or archive management
  357. 14:03okay
  358. 14:04interpreters for common languages and
  359. 14:06support from it
  360. 14:09okay
  361. 14:10so next is communications
  362. 14:13programs for providing connectivity
  363. 14:15between
  364. 14:17processes or
  365. 14:18again when you process this our program
  366. 14:20and execution or running program
  367. 14:22and the users so including mail web
  368. 14:25browsers remote logins file transfers
  369. 14:29okay and remote command execution so
  370. 14:31that's
  371. 14:32under communications
  372. 14:35all right
  373. 14:37next background services
  374. 14:40so system demons are commonly started
  375. 14:43when the system is booted
  376. 14:45and run
  377. 14:46for as long as the system is running so
  378. 14:49handling necessary services
  379. 14:51examples include network demons
  380. 14:54print servers
  381. 14:56process schedulers and system error
  382. 14:58monitoring services
  383. 15:01all right
  384. 15:03and the last one is application programs
  385. 15:05so don't pertain to system
  386. 15:07okay so once the application programs
  387. 15:09these are run by the users
  388. 15:12not typically considered part of the
  389. 15:14operating systems
  390. 15:16okay
  391. 15:18all right so next is linkers and loaders
  392. 15:22all right
  393. 15:23so source code compiled into an object
  394. 15:26files designed to be loaded into the
  395. 15:28physical or any physical memory location
  396. 15:30so we look at a relocatable
  397. 15:33object file
  398. 15:34it's just like when we created our first
  399. 15:36program in c plus plus okay so basically
  400. 15:39what we see on the screen is our source
  401. 15:40code all right and that source code is
  402. 15:43usually in that cpp format
  403. 15:46okay
  404. 15:48so
  405. 15:49this source code when we compile it well
  406. 15:52that generates an object file
  407. 15:54okay
  408. 15:56so linker
  409. 16:00linker combines this into a single
  410. 16:02binary executable file
  411. 16:05also brings in libraries so program
  412. 16:07resides on the secondary storage as
  413. 16:09binary executable must be brought into
  414. 16:12the memory by a loader to be executed
  415. 16:16okay
  416. 16:17so relocation assigns final address
  417. 16:20to program parts and adjusts code and
  418. 16:23data in program to match those addresses
  419. 16:28so modern general purpose systems don't
  420. 16:30link libraries into executables rather
  421. 16:33dynamically link libraries or dll so
  422. 16:36that is what we use in windows are
  423. 16:38loaded as needed
  424. 16:39shared by all those that use the same
  425. 16:41version
  426. 16:42of that same library
  427. 16:44okay
  428. 16:45so object executable files have standard
  429. 16:48formats so operating system knows how to
  430. 16:51load and start them
  431. 16:53okay
  432. 16:54so
  433. 16:55if you will observe in
  434. 16:58c plus plus not during our early days in
  435. 16:59programming okay so once we created a
  436. 17:02program let's say that cpp okay so we
  437. 17:05usually compile it okay so with a
  438. 17:08successful compiling okay meaning no
  439. 17:11errors
  440. 17:12so that generates an object file
  441. 17:15okay that object file when we run that
  442. 17:18program
  443. 17:19okay
  444. 17:20and
  445. 17:21that object file
  446. 17:23is executed
  447. 17:24so we can see an output on the screen
  448. 17:27all right
  449. 17:28so
  450. 17:29that's what we do
  451. 17:31during our early days in programming so
  452. 17:33you that uses linkers and loaders okay
  453. 17:36so compilers are used for high-level
  454. 17:38language programming
  455. 17:40and at low level
  456. 17:42instead of compilers we use assembler
  457. 17:45okay so compiler high level programming
  458. 17:48assemblers low level programming
  459. 17:51okay
  460. 17:52so what is the role of the linker in the
  461. 17:54loader so for example this is what i'm
  462. 17:56i'm talking earlier
  463. 17:57okay so for example you have the source
  464. 17:59program
  465. 18:00main.c or main.cpp okay so when we
  466. 18:03compiled it
  467. 18:04it creates an object file
  468. 18:06okay
  469. 18:08so next is
  470. 18:12when
  471. 18:13we load it
  472. 18:15okay so the linker
  473. 18:16with other object files associated with
  474. 18:18that
  475. 18:19will generate an executable file okay so
  476. 18:22that's the linker there so compiler
  477. 18:24linker
  478. 18:25so compiler from source to object file
  479. 18:29from object file to executable file
  480. 18:31linker
  481. 18:32and if there are other object files
  482. 18:34there so that would be linked up also
  483. 18:37okay and an executable file to be loaded
  484. 18:40onto the ram for execution
  485. 18:43and calling other dynamically linked
  486. 18:45libraries or dll so that is where loader
  487. 18:47comes in
  488. 18:49okay so basically we don't care about
  489. 18:51this during our early days in
  490. 18:52programming all right so what we want to
  491. 18:55see there is just our code our program
  492. 18:57is successfully running
  493. 19:00all right
  494. 19:10[Music]
  495. 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.