Skip to content

valignatev/sleep-from-scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a completely standalone sleep implementation for x86_64 Linux that depends only on the Linux kernel.

I made it for my YouTube video which you can find here:

https://www.youtube.com/watch?v=IbibjkI1kIs

Sources:

GCC inline assembly howto

System V Application Binary Interface

GCC Manual

License: either MIT or Public Domain, whichever you prefer.

Build:

rustc -o sleep_rs ./sleep.rs --edition=2024 -Copt-level=3 -Clink-arg=-nostartfiles  -Cpanic=abort -Cstrip=debuginfo

gcc -o sleep_c -O3 -nolibc -fno-stack-protector -nostartfiles sleep.c

About

sleep for x86_64 Linux from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published