Тёмный

Unix system calls (2/2) 

Brian Will
Подписаться 96 тыс.
Просмотров 105 тыс.
50% 1

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 91   
@W1Wyrm
@W1Wyrm 4 года назад
Thanks! Almost 10 years later still completely relevant and cover a lot of ground.
@Kabodanki
@Kabodanki 3 года назад
there's no use for the base of syscall to change
@lawrencemanning
@lawrencemanning 3 года назад
@@Kabodanki Yup we'll be stuck with this 1970s Unix forever....
@JosephRawsonWorks
@JosephRawsonWorks Год назад
Bloody fofum buffer overflow
@louis9116
@louis9116 2 года назад
came to learn about syscalls, but this man just summed up my entire OS course. Cannot thank you enough
@rweaver6
@rweaver6 7 лет назад
High quality tutorial. No fumbling for words, moves along efficiently and covers the architectural fundamentals.
@ThunderAppeal
@ThunderAppeal 5 лет назад
This guy is brilliant. So refreshing to hear this explained without some foreign accent by someone who knows exactly what they are talking about.
@godnyx117
@godnyx117 Год назад
I have no words! Wherever you are, I hope that you are doing great!
@takshpatel8109
@takshpatel8109 Год назад
One of the best Linux explainer 🌟🌟🌟
@photoallergic
@photoallergic 8 лет назад
Aw man, thanks so much for these videos. I'm a teaching ass. for HPC at uni and I know all this stuff, but having it read aloud and so well explained puts me in soothing, precious slumber with a peaceful smile. "Yes ... yes, that's how block devices work ..."
@mikaelohlin6869
@mikaelohlin6869 4 года назад
Partition 0 is where the formatting pattern is stored, so the first readable partition lies on top of that layer. That is also why the disk isn't as big as the producer tells you because it takes some bytes each slice that gets marked.
@rancidbeef582
@rancidbeef582 3 года назад
Just to be pedantic, you can link() the same file to two different filenames even in the same directory. For example, on an old Unix System V machine I used to use where disk space was at a premium, the /bin/cp, /bin/mv, and /bin/ln programs were all linked to the same actual file, since those operations have a lot in common. When run, the program will check argv[0] (i.e. the file name of the program), to figure out which operation to perform. Pretty sneaky!
@johnnybravo2342
@johnnybravo2342 2 года назад
busybox uses the same metod i think :)
@godnyx117
@godnyx117 Год назад
That's actually very smart, even in modern systems. Like mentioned, Busybox does it and I plan to do the same in the future when create these programs in my language.
@Danscottmusic
@Danscottmusic 8 лет назад
Thanks, these videos have covered a lot that I wasn't understanding!
@Locane256
@Locane256 7 лет назад
These videos really helped me round out my understanding of Unix basics. I would have been a lot more lost without being taught some basics first - these videos really helped solidify knowledge I had that was fragmented... created an inode table to map to a larger directory structure, if you will ;)
@МаксПреображенский-ы3у
If someone wondering about real syscalls signatures, not just python-like pseudo-code, you can always type "man 2 " into your shell and get the answer.
7 лет назад
thanks for this, far the most useful video on the topic!
@impaque
@impaque 7 лет назад
Thank you very much for these series, they're very informative and very well presented.
@CMDRunematti
@CMDRunematti 4 года назад
lp starts from 0 because it always would have a printer, but wouldn't necessarily have a storage device (like back in the day when you typed your programs in)
@phyyl
@phyyl 2 года назад
The V in SIGSEGV stands for Violation
@jacksonfive5180
@jacksonfive5180 4 месяца назад
Fantastic explanation.
@Mr.Nichan
@Mr.Nichan 2 года назад
39:04 I believe that's spelled "SCSI device", for "Small Computer System Interface device" (not, for instance, "scuzzy device", using "scuzzy", a 1960s coinage for "dirty", "grimy", "disreputable", or "sleazy").
@carlyounger6262
@carlyounger6262 Год назад
I wish I'd found these videos 12 years ago.
@shirleyachara3809
@shirleyachara3809 3 года назад
Great lecture with very useful example codes.
@sourashismondal5060
@sourashismondal5060 10 месяцев назад
Please make a video of how exception handling works internally.
@kamilkowalski776
@kamilkowalski776 3 года назад
segv = segmentation violation ?
@amandafalke7670
@amandafalke7670 6 лет назад
Great videos that really complement my Embedded Operating Systems class. Thank you!
@sasuke2910
@sasuke2910 8 лет назад
A process can send signals to other that are owned by the same user? Does this mean that typical programs have the ability to kill each other?
@briantwill
@briantwill 8 лет назад
+Jeru Sanders Yes, this is the case. It's one reason why 'important' programs tend to be set up with their own user account.
@omkarajagunde4175
@omkarajagunde4175 4 года назад
At unix time signal were only sent for killing other processes and not for IPC or any other thing but as time passed developers found signals can be used for other good things for IPC sending interrupts etc .. There is a table like structure in U-area of each process where one column is all the signals supported by OS (19 signals supported in case of UNIX) and 2 second column consists of signal catcher function address passed as parameter by the programmer by calling signal system call in their programs then when a process is switching mode to user mode from kernel mode "isSig" algorithm is executed to see which signals are received by the process and not yet serviced and then to serve these queued signals "psig" algorithm is executed and if a particular signal is not specified with catcher function then default address corresponding to the second column of that signal consists by default 0 address which is exit() system call address and the process is put in Zombie state by the kernel. You can see signal macros in
@dixztube
@dixztube Год назад
Learned a lot here. Thanks!!
@esantix
@esantix 4 месяца назад
On min 33:15: what does it mean there's a buffer for each block? All storage is "repeated" on disk and the buffer?
@iberianful
@iberianful Месяц назад
Great tutorial.
@patrickmullen2914
@patrickmullen2914 Год назад
Great video. I learned a lot 👍
@smorrow
@smorrow 4 года назад
7:56 "read works this way basically for performance reasons" And reading from the terminal.
@Halogrunt1234
@Halogrunt1234 10 лет назад
I was very entertained by your herp derp and bla bla example of nonatomic file writes.
@mcechss
@mcechss 7 лет назад
"her blap" lol
@berargumen2390
@berargumen2390 3 года назад
I watched this video like 7 years ago, but just know i undesrtand this
@Mr.Nichan
@Mr.Nichan 2 года назад
10:16 Given everything else you said here, it seems like it should have been mentioned what happens when you write when the marker is NOT at the end of a file. I'm guessing you thought it was obvious that you would overwrite the data, like a hard drive, rather than inserting data, as is now the default in modern text files, though it requires changing the addresses of every byte later on in the file. That's sort of implied by the fact that you only say it expands the file if the marker goes past the end of the file. In addition to simply being more complicated, inserting would expand the file no matter where the new data was written in, and would also require separate deleting calls for completion.
@abdulmoizsheikh8031
@abdulmoizsheikh8031 3 года назад
4:25 Can someone please explain why a write() call is not guaranteed? I just checked the man pages for write and it clearly says that on a successful write call, the number of written bytes is returned. Have I missed something here?
@easilyexplained-inenglishh9491
@easilyexplained-inenglishh9491 3 года назад
Hi Abdul! I had the same question, and found this in the man page for 'write', under 'NOTES': A successful return from write() does not make any guarantee that data has been committed to disk. On some filesystems, including NFS, it does not even guarantee that space has successfully been reserved for the data. In this case, some errors might be delayed until a future write(2), fsync(2), or even close(2). The only way to be sure is to call fsync(2) after you are done writing all your data.
@hacker64xfn99
@hacker64xfn99 2 года назад
I hope u see my comment as this video was not published 11 years ago : How does device drivers actually work in these system calls, are not drivers the ones responsible for managing their devices associated with, as they create their device objects ? In Microsoft Windows, what is the Device object file and is the symbolic link object (found in ObjManager.exe) same as these symbolic links mentioned in this videos ? Also, does the DevDevice file object (at object manager) contain block and character device files equivalent to the dev/ directory in unix-like systems ? Anyways, great content, keep up your work 😊
@JosephRawsonWorks
@JosephRawsonWorks Год назад
I used mkfifo for named pipes
@buihung3704
@buihung3704 Год назад
I though ReadWrite is controlled by semaphores? You can have many reads at the same time but only 1 write can occur at any time. How the hell can you have multiple write and multiple read at the same time? Is it a really serious problem if 2 write overwriting each other in the buffer, results in corrupted data? Edit: Ah I get it, so the buffer doesn't have coordination by default, it solely relies on the human developers of a specific program (Dev team of MySQL for instance) to control the read and write explicitly using multiple techniques, one of them is using semaphore.
@nofmxc
@nofmxc 2 года назад
I know this is old, but are the character device file buffers stored in the operating systems memory space? Or on disk? Or on the device?
@davidbekic6569
@davidbekic6569 2 года назад
Been wondering the same thing, t'as trouvé la réponse?
@KillYourFinger
@KillYourFinger 7 лет назад
your videos are a blast man! helped me so much! keep it up please
@DrRChandra
@DrRChandra 9 лет назад
mmmm.....no, rmdir(2) will not remove a file (you showed "remove a file or directory"); the only object it will remove is a directory. unlink(2) will remove anything except directories to which you have permissions to do so. It's also worthy to note a file continues to exist anonymously until there is no longer any process with it open. I used to run into that all the time with a database program which would create some temporary files (for temporary tables), and I needed to free up disk space because the filesystem was full. I could rm(1) them, but the disk would still be full until I shut down the database (and thus its process called close(2) or _exit(2)).
@haispdn
@haispdn 11 лет назад
Very useful lecture.. highly recommended
@rathnec
@rathnec 4 года назад
Thanks Brian.. A doubt on segmentation, I think paging did not make segmentation obsolete, right?.. Page fault and sen fault are two different issues.. Page fault can't be considered as an error.. it just means that the page the process is looking for is not found in the main memory.. Seg fault on the other hand is actually an unauthorized access of memory area which cause the process to terminate.. Is this right!!?
@lawrencemanning
@lawrencemanning 3 года назад
Pages and segments do the same thing and are a means to isolate address spaces. The V in SIGSEGV is short for violation I believe, and refers to segments because, presumably, the first UNIXes ran on computers that used segments for process isolation. So a context switch would update the various segment registers instead of switching page tables, as happens now.
@cyrilemeka6987
@cyrilemeka6987 7 месяцев назад
49:58 what of SIGINT?
@adityanagesh4922
@adityanagesh4922 3 года назад
Why can't unnamed pipe be used by unrelated processes? When we create a pipe is the r and w permission for the file only given to the real id of the program?
@ziaahmad8738
@ziaahmad8738 3 месяца назад
Thank you!
@xieliming
@xieliming 12 лет назад
As he said in previous video, it is pseudocode in the styling of Python. The actual code for making these calls is C
@fuanka1724
@fuanka1724 6 лет назад
Excellent videos!
@movq7539
@movq7539 2 года назад
really good
@RogueSignal
@RogueSignal 5 лет назад
lseek might stand for Linear Seek since it goes down the line.
@WeightlessFlex
@WeightlessFlex 3 года назад
Do you have a Unix networking seriesor know of a good one
@supa1009
@supa1009 5 лет назад
You sir, are a true legend!
@carloseduardomarciano1395
@carloseduardomarciano1395 7 лет назад
Amazing video, thanks for the lecture!
@fatty-it-man
@fatty-it-man 10 месяцев назад
Super great video! Good for preparation for interviews)) in 47:47, in SISEGV, I think that "V" means "violation"
@subee128
@subee128 8 месяцев назад
Thanks
@m3hdim3hdi
@m3hdim3hdi 4 года назад
I cant thank you enough
@MrFrankSpierings
@MrFrankSpierings 11 лет назад
sigsegv => segmentation violation ;)
@LytGamingV1
@LytGamingV1 12 лет назад
are all of these examples written in python?
@shirleyachara3809
@shirleyachara3809 3 года назад
Thanks.
@TheTarnonero
@TheTarnonero 7 лет назад
good videos ! thanks for a good explanation!
@rne1223
@rne1223 13 лет назад
is the website down?
@yourfutureself4327
@yourfutureself4327 Год назад
💙
@normally96
@normally96 5 лет назад
thank you.I eager to join your course but I can't access the link in the description. Can you give me another link ?
@melvyniandrag
@melvyniandrag 6 лет назад
very useful!
@idobenamram3743
@idobenamram3743 6 лет назад
so good
@AmitKumar-zy9ug
@AmitKumar-zy9ug 12 лет назад
i guess V in SIGSEGV means System V? but i can be wrong.
@omkarajagunde4175
@omkarajagunde4175 4 года назад
V here means Violation
@swapnilhitman
@swapnilhitman 11 лет назад
Very informative ... Thank you.
@luckyboy20021
@luckyboy20021 6 лет назад
thank alot
@erikbmyname
@erikbmyname 11 лет назад
Thanks for these!
@krzysztof-ws9og
@krzysztof-ws9og 4 года назад
I have managed to divide by '0' without getting SIGFPE I have got +inf as a result
@xrafter
@xrafter 4 года назад
'0' is charachter which is 48 in his maping in ascii But 0 is 0 not 48
@smorrow
@smorrow 4 года назад
You didn't cause the actual computer to divide by zero.
@coolwinder
@coolwinder 8 лет назад
Can i ask one dumb question? How do i call e.g. chdir or mkdir...? Where is it, is it some compiled C executable, and if yes, where is it? So i am reading chdir man page man7.org/linux/man-pages/man2/fchdir.2.html and it tells me to include some lib , so there are functions? So if i want to call functions in C to read and write files i need to use librarys for reading and writing found on that operating system? So what is then, is it standard library that is writen separately for each OS, so when i am writing program in C i dont need to rewrite my program each time i want to compile it for different OS? And lib is calling open system call for function fopen for Linux, in windows it would call something else? This isn't realy one question, but my train of thought. Maybe i should put it on reddit (/r/Showerthoughts/) :D. Thanks.
@gigiduru125
@gigiduru125 8 лет назад
In Linux these are in the libc library www.gnu.org/software/libc/manual/html_node/Working-Directory.html#Working-Directory. Linux and Windows have different APIs and system calls, fork() in Windows is called CreateProcess(), has different parameters and is part of the Windows (Win32) API en.wikipedia.org/wiki/Windows_API.
@omkarajagunde4175
@omkarajagunde4175 4 года назад
@@gigiduru125 Yes as windows believes in thread based processing and at UNIX time their was only legacy Process based processing
@omkarajagunde4175
@omkarajagunde4175 4 года назад
mainly chdir() and mkdir() at UNIX period was a system call, also i must tell you that chdir and mkdir are also internal commands of shell(shell have 2 types of commands internal and external), the code for internal commands like."ls" and ''cd" (chdir) is implemented by shell itself so their binary executable is no where separate but their code lies in the binary executable of shell, If a command is external command then it lies in /bin directory. Hope that helps !.. for further reading you may read Maurice J Bach book
@harishkumars3209
@harishkumars3209 12 лет назад
i'm interested in developing os can u help me
Далее
Unix system calls (1/2)
45:16
Просмотров 434 тыс.
Unix terminals and shells - 1 of 5
16:28
Просмотров 105 тыс.
I Built a SECRET Lamborghini Dealership!
33:02
Просмотров 8 млн
How Many Twins Can You Spot?
00:17
Просмотров 11 млн
Hardware Basics
25:34
Просмотров 97 тыс.
Operating System Basics
23:16
Просмотров 665 тыс.
AT&T Archives: The UNIX Operating System
27:27
Просмотров 2 млн
Top 10 Linux Job Interview Questions
16:04
Просмотров 2,4 млн
Linux Performance Tools, Brendan Gregg, part 1 of 2
54:29
How Do Linux Kernel Drivers Work? - Learning Resource
17:02
Steven Rostedt - Learning the Linux Kernel with tracing
1:07:25
Learning the Linux File System
25:09
Просмотров 1,2 млн
I Built a SECRET Lamborghini Dealership!
33:02
Просмотров 8 млн