Making Cat Command from Scratch with Assembly

  Рет қаралды 6,197

Nir Lichtman

Nir Lichtman

Күн бұрын

Пікірлер: 31
@edgeeffect
@edgeeffect Жыл бұрын
It's nice to see somebody covering Assembly Language on KZbin with examples that actually DO SOMETHING... I'd rather you were doing MIPS and din't have an operating system, but I can't have EVERYTHING. ;)
@YilmazDurmaz
@YilmazDurmaz 11 ай бұрын
a practical demo to show how to use what you only read from books. nice!
@jasdfff770
@jasdfff770 8 ай бұрын
Good video! One suggestion: a video comparing the assembly generated by a program made in C with the same program if you were to write it directly in assembly.
@thesushifiend
@thesushifiend 8 ай бұрын
Very clever. I didn’t understand much but now I’d like to see an implementation of “dog”.
@ZecaSamicas
@ZecaSamicas Жыл бұрын
Even that assembly is getting more and more obsolete these days because of the learning curve. We can't ignore the fact that it has been not forgotten after all these decades, even with the new technology, in some rare cases, assembly is still the best choice (or C).
@noelgallagher3646
@noelgallagher3646 Жыл бұрын
Assembly is not difficult just tedious. What I like is it does not give you a helping hand. Even c with a modern compiler helps you too much with optimisations. In this regard, you end up writing suboptimal code without realising since the compiler helped you
@ZecaSamicas
@ZecaSamicas Жыл бұрын
@@noelgallagher3646 Indeed Assembly can consume a lot of time, But after all, It'll probably be worth it
@noelgallagher3646
@noelgallagher3646 Жыл бұрын
@@ZecaSamicas if your goal is to be a better programmer and understand what is happening on a low level then yes absolutely
@edgeeffect
@edgeeffect Жыл бұрын
ALL software is Open Source... IF you can read Assembly Language!
@anukranan
@anukranan 10 ай бұрын
@@edgeeffect Read the hex, translate them opcodes
@cangozpinar
@cangozpinar Жыл бұрын
How can one fine the information used in this video such ad thr +16 bytes for the first arg ?
@billybobjankens12
@billybobjankens12 11 ай бұрын
The way someone can find this information is by searching through books, documents, and other things
@smartnima
@smartnima Жыл бұрын
Keep making this amazing content!
@iAmVonexX
@iAmVonexX Жыл бұрын
i barely understood half of it but damn you know how to make videos simple but interesting
@nirlichtman
@nirlichtman Жыл бұрын
Thanks! What specifically did you not understand? I can help explain
@iAmVonexX
@iAmVonexX Жыл бұрын
i might have exaggerated what i understood. i'm not a dev by any means so you would have to explain basically everything to me. and that might go beyond the scope of a youtube comment ^^
@nirlichtman
@nirlichtman Жыл бұрын
@@iAmVonexX 👍 if you want a more beginner friendly video that could help understand this a little better I would recommend my video explaining linux system calls
@jasdfff770
@jasdfff770 8 ай бұрын
It would be nice a video explaining the function of each register. Nice work, by the way!!
@JoaoCarlos-df1zw
@JoaoCarlos-df1zw Жыл бұрын
The real definition of blazing fast
@darshangaikwad1392
@darshangaikwad1392 Жыл бұрын
this is good make more stuff like this
@ayoubelmhamdi7920
@ayoubelmhamdi7920 Жыл бұрын
viewing the registers names, doesn't mean we remember all of them, i think the better way, is to keep a small table on the right side, so we not be lose the context
@nirlichtman
@nirlichtman Жыл бұрын
That's a good idea, thanks for the feedback 👍
@MarkVeltzer
@MarkVeltzer Жыл бұрын
This is weird, I keep getting EINVAL on the call to sendfile.... I tried a version of C of this with simply open(2) and sendfile(2) and got -EINVAL too...
@nirlichtman
@nirlichtman Жыл бұрын
What kernel version and architecture are you using?
@ibragimyouldachevcn3415
@ibragimyouldachevcn3415 Жыл бұрын
@nirlichtman It appears that the occurrence of EINVAL is attributed to the fact that 'stdout' has the O_APPEND flag. Specifically, the error is described as follows: "EINVAL out_fd has the O_APPEND flag set. This is not currently supported by sendfile()."
@AMith-lv2cv
@AMith-lv2cv Жыл бұрын
more of this masterpiece
@tankman1301
@tankman1301 Жыл бұрын
awesome!
@codedsprit
@codedsprit Жыл бұрын
Here we gooo
@Haydenz11
@Haydenz11 6 ай бұрын
A+
@patriciaverso
@patriciaverso Жыл бұрын
I can't seem to make this work. I don't know if the Kernel version has anything to do with it. I'm getting this as my strace. Do you think you could take a look? execve("./a.out", ["./a.out", "cat.asm"], 0x7ffdd1a38548 /* 85 vars */) = 0 open("cat.asm", O_RDONLY) = 3 sendfile(1, 3, NULL, 100) = -1 EINVAL (Invalid argument) ^C--- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} --- I also tried the sendfile syscall in C to check if that was faulty for some reason, but that worked.
@nirlichtman
@nirlichtman Жыл бұрын
Interesting and did you run the strace on the C code as well to see how sendfile was called? Also what is your setup - distro version and arch?
Making pwd Command From Scratch in Assembly
2:08
Nir Lichtman
Рет қаралды 4 М.
Become an Awe$ome Linux SysAdmin In Under 2 Hours
1:54:40
Hank Hackerson
Рет қаралды 117 М.
«Жат бауыр» телехикаясы І 26-бөлім
52:18
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 434 М.
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
Making Simple Graphical Linux Distro from Scratch
17:19
Nir Lichtman
Рет қаралды 67 М.
Making Ping Command From Scratch in Assembly (x64)
11:19
Nir Lichtman
Рет қаралды 7 М.
Making Snake Boot Sector Game in Assembly (x86)
19:52
Nir Lichtman
Рет қаралды 12 М.
Essential Linux Commands - Cat, Tac and Tee
21:07
DistroTube
Рет қаралды 24 М.
Linux Modules Explained!
10:18
Professor Linux
Рет қаралды 10 М.
Let's Create a Compiler (Pt.1)
1:11:03
Pixeled
Рет қаралды 581 М.
Making Minimalist Web Server in Assembly on Linux (x64)
18:31
Nir Lichtman
Рет қаралды 37 М.
Making Minimalist Chat Server in C on Linux
14:28
Nir Lichtman
Рет қаралды 44 М.