- 106
- 1 704 395
Nir Lichtman
Israel
Registrace 15. 12. 2011
Programming Videos for Programmers and Advanced Software/Workflow Tips
What Happens If We Stack Overflow in Linux Kernel
What Happens If We Stack Overflow in Linux Kernel
zhlédnutí: 4 596
Video
Drawing Graphics with C and Windows API is Easy
zhlédnutí 12KPřed 9 hodinami
In this video I will demonstrate basic usage of Windows GDI to draw graphics on the screen. Code: github.com/nir9/poc/blob/master/win/draw.c
Making Minimal Linux Distro with Buildroot
zhlédnutí 15KPřed 19 hodinami
In this video I will demonstrate how you can use Buildroot to create a simple x64 Linux distro Dependencies (Ubuntu packages): apt install g make libncurses-dev unzip bc bzip2 libelf-dev libssl-dev extlinux
Making a Very Minimal Windows Executable in C
zhlédnutí 60KPřed 14 dny
In this video I will demonstrate how you can instruct the Visual Studio linker to produce a very minimalist executable You can get the reverse engineering software that I use in the video by running "winget install Rizin.Cutter"
Screwing Up Linux Kernel Keyboard Driver
zhlédnutí 23KPřed 14 dny
Screwing Up Linux Kernel Keyboard Driver
What Happens When Booting Linux with Low Memory
zhlédnutí 59KPřed 21 dnem
In this video I will demonstrate how Linux reacts when it boots with too little memory. Documentation used in video: Kernel Docs - SysReq: docs.kernel.org/admin-guide/sysrq.html Wikipedia ASLR: en.wikipedia.org/wiki/Address_space_layout_randomization
How Windows API Works Under the Hood
zhlédnutí 13KPřed 28 dny
In this video we will follow a Python open file function call all the way to the native API of Windows. Tools: - windbg - winget install windbg - Visual Studio Build Tools - Python 3.10 IDLE Docs used in video: NtDoc (unofficial) - ntdoc.m417z.com/ntcreatefile Win32 Docs (official) - learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew Python 3.10 docs - docs.python.org/3....
What Happens When Linux Runs Out of Memory?
zhlédnutí 52KPřed měsícem
In this video we will explore how Linux reacts to a low memory situation. Kernel documentation article from video: www.kernel.org/doc/gorman/html/understand/understand016.html
How does a USB keyboard talk with your computer?
zhlédnutí 17KPřed měsícem
In this video I demonstrate how you can sniff USB packets and identify the packets coming from the keyboard. Installations: - usbpcap - winget install usbpcap - wireshark - winget install wireshark Docs: - OSDev Wiki HID page -wiki.osdev.org/USB_Human_Interface_Devices
Making Minimalist Web Server in C on Windows
zhlédnutí 6KPřed měsícem
In this video I will demonstrate how to make a simple web server in C on Windows using Windows Sockets (winsock). Code: gist.github.com/nir9/2db83a89c18a8add1e705710e9303208
Reverse Engineering Simple Windows Driver
zhlédnutí 6KPřed měsícem
In this video I will demonstrate how you can reverse engineer a simple "Hello, World" driver on Windows 10. Dependencies: - Cutter: winget install Rizin.Cutter - Windows Debugger (windbg): winget install Microsoft.WinDbg Docs: - DbgPrint: learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-dbgprint - COM Port Kernel Debugging: learn.microsoft.com/en-us/windows-hardware/drivers/deb...
The Importance of Resource Cleanup in C
zhlédnutí 5KPřed 2 měsíci
In this video I will explain the importance of cleaning up resources when programming C. Dependencies: - lsof (can be obtained with your package manager for example in Ubuntu/Debian run "apt install lsof")
Windows API Window Messages Explained
zhlédnutí 3,1KPřed 2 měsíci
Windows API Window Messages Explained
Making Snake Boot Sector Game in Assembly (x86)
zhlédnutí 9KPřed 2 měsíci
Making Snake Boot Sector Game in Assembly (x86)
Making Minimalist Web Server in Assembly on Linux (x64)
zhlédnutí 34KPřed 2 měsíci
Making Minimalist Web Server in Assembly on Linux (x64)
Windows API Memory Mapped Files Explained
zhlédnutí 5KPřed 2 měsíci
Windows API Memory Mapped Files Explained
Making Simple Shared Object (.so) in C on Linux
zhlédnutí 7KPřed 2 měsíci
Making Simple Shared Object (.so) in C on Linux
3 Cool Bash Tricks (Jobs, Debugging Scripts, Math)
zhlédnutí 5KPřed 2 měsíci
3 Cool Bash Tricks (Jobs, Debugging Scripts, Math)
Making Simple Graphical Linux Distro from Scratch
zhlédnutí 46KPřed 2 měsíci
Making Simple Graphical Linux Distro from Scratch
Making Tiling Window Manager in C on Windows
zhlédnutí 33KPřed 3 měsíci
Making Tiling Window Manager in C on Windows
Making Minimalist Chat Server in C on Linux
zhlédnutí 38KPřed 3 měsíci
Making Minimalist Chat Server in C on Linux
Making Driver That Blue Screens Windows using C
zhlédnutí 5KPřed 3 měsíci
Making Driver That Blue Screens Windows using C
Making Simple GUI Window in C on Windows
zhlédnutí 17KPřed 4 měsíci
Making Simple GUI Window in C on Windows
Making Simple X11 GUI Window in C on Linux
zhlédnutí 20KPřed 4 měsíci
Making Simple X11 GUI Window in C on Linux
Adding Simple System Call in Linux Kernel
zhlédnutí 11KPřed 4 měsíci
Adding Simple System Call in Linux Kernel
- For more information about how the guard pages are used in the kernel to detect stacko check out this article from the kernel docs docs.kernel.org/mm/vmalloced-kernel-stacks.html - In this video I demonstrate with x64, but on other architectures (like ARM for example) this may work differently
Can you make a small Linux distro with the Rust coreutils?!!!
im so glad to not be the only one that has the kind of intrusive thoughts that makes you wanna stack overflow a kernel
😂
Hi @Nir Licthman this is a wonderful video... Can u make a sereis on the linux kernel internals the code walk through and steps that the kernel takes from start to finish
Yes I plan on also making videos about the boot process focusing on a specific subsystem each time
@@nirlichtman Thank you so much ❤️ That would mean a lot to all of the people here .... Again Thank you
Another excellent video! Keep up the content man this is great stuff
Are you using WSL in the video ?
He is
@@rishaydutt812 thanks. i just had a doubt cuz it looked a bit different then usual wsl
lol i was kind of expecting an angry linus mail about people doing like mid tier coding advice in merge requests to the kernel like stack overflow
Good video!!!! Nir, I have a question please: I run this program on Windows and Linux, on Linux it takes less than 1 second and on Windows it takes almost 2 minutes. Why does that happen? #include <stdio.h> #define MAX 1000000 int main(int argc, char *argv) { int i; for(i=1;i<=MAX;i++) { printf("%d ",i); } printf(" "); return 0; } Thanks for anything you can support.
11:23 cp $(ldd nano-X | awk '!/ld-linux|vdso/ {print $1}' | xargs) /distro/lib/x86_64-linux-gnu/
curious what happens if you comment out that call to `die` and `panic`
Memory corruption, CPU memory exceptions
Detected😢
Try make a video where you disable the ISR(Interrupt service routine) in charge to manage division by zero, then try to run such division in user space and see what happens.
Well obviously the CPU can't handle it so the ISR is triggered. So it depends on _how_ you remove it. Remove the code in it? Handler does nothing, you have a CPU bound infinite loop that the scheduler can still deal with. Remove it from the ISR table? Kernel panic (double fault -- invalid ISR entry). You can also try to not change the kernel and register a signal handler for SIGFPU in the userspace, and if you do nothing in that you're gonna again have the infinite loop.
Such a fun video, I’ve never really thought too much about kernel issues like this. It’s very easy to forget it even exists and has to follow the same rules when developing user mode software
It’s pronounced qemu.
I’d be interested about what the convention is for kernel dev. I presume kernel maintainers generally avoid recursion?
Same thought here… also, does that mean kernel code is always free of any warnings?
@@pachingeryes, though the rules are set up so any irrelevant warnings may be changed to notes or discarded
Generally no recursion, though in some situations you do get some (btrfs for example uses up a lot of stack space)
Kernel panic attack :(((
noooo :(
Thank you for showing so many interesting stuff on your channel, a peak into the inner workings of things is always great.
It makes me happy to see new comers try this stuff out; It's how you learn and become better at programming, etc
Nice vid, looked similar vid a few weeks ago. Simple, good understandable, short, nice vid Thanks Nir
cool !
Hi! what will happen if you remove die() or other interruption in kernel code? what would happen on StackOverflow?
I imagine it would just go “off into the weeds” since it has no way to handle an unrecoverable error
@@BenjaminWheeler0510technically it could keep going but it’s likely memory corruption would cause either an infinite loop or a number of CPU exceptions
If you remove the handler for CPU exceptions, they generate a double fault, if you remove that, or the code for it is unreachable (for instance, you get a segmentation fault when trying to reach that code) then it will generate a triple fault and reboot your machine
Next video create a kernel module from scratch but something interesting, like a kernel mod to put a camera filiter or a voice filter or a custom keyboard mapping something like that would be really fun
It's actually possible I had found an article on it. You can make a module without needing the kernel sources
@@Nunya58294 no that I know, my focus was on the second part
I love your videos, straight to the point
the only problem that we can't solve when beeing root
Sometimes you need to be root for this stuff...
hi!
Wow, this was so simple and nice explanation. I knew GDI but thought it was too low level, but this is so cool. You also explained how to use cmd tool cl.exe and how to refer to microsoft docs. Please make more videos on GDI. Maybe two series, one that covers creating a UI using GDI, other that shows how to make a simple game using GDI.
Is that a tiling WM thing in windows lol?
Yes, I am working on one called LightWM
The only man that programs on Windows like it's 1990 UNIX.
oh lol, i am not going to watch 10 next videos in the playlist all generically titled "cool commands to save time" 🤣😂 i am not sure there's much that can be done about it though..
0:53 python's pudb is good. rest all (gdb, chrome web tools, python's default pdb) suck one way or the other. or, jetbrains' ide (intellij, pycharm, etc) debuggers are good too. they too don't throw much at the editor, rather focus on making the data (values, variables etc) while debugging to be easier to access and watch
that's where novim shines. its client-server abilities allow to use it kinda native, rather than in an emulation. i am not saying though that it is as good as vanilla novim.
0:24 what i don't understand is, why the lower case `i` or `a` etc don't work in the visual mode? or otherwise say, which others are there which work? `c`, `I`, `A` ... what else?
it doesn't seem to be working in neovim v0.10.0-dev-3078
عجيب جدا يا انك فاضي
My tiniest executable ever was 20 bytes, it set the terminal width from 25 to 50 lines.
what is the real reason people still use windows?
Wow. Didn't know you can draw stuff without a window on windows. Not sure what it would be useful for but that's pretty cool.
Nice! Liked and Subscribed!
I cannot stress enough how much I love straight-to-the-point-no-bs videos such as yours.
Sending email with c please 😢
Sending email with c please 😢
how can we implement uefi boot using buildroot?
i am currently compiling buildroot after navigating cluelessly through the menuconfig and enabling support for iw(,d), nano, uefi using grub, ext4 filesystem, htop, git, and other stuff i forgot. I hope i can succeed.
This is very cool but how to add a config file syslinux.cfg in this process??
You make such intresting videos!
do one with winrt
That was even faster and easier than Rob Landley's video on a minimal Linux, nice!
I like to use zsh with oh-my-zsh and as plugins zsh-autosuggestions and fzf zsh-autosuggestions always shows the CTRL+R thing while you're typing (but in a muted color) fzf makes the CTRL+R thing nicer by showing a list of matches that you can scroll through (and other things)
Why is buildroot suddenly a minor trend 90% of my recommendations are about buildroot
Simple and short . Exactly what i was looking for
ur funny