This repository contains exercises and examples focused on system calls and interacting with the operating system using assembly language. These examples are built using NASM assembler on a Windows x64 environment, and they illustrate how to interact with OS services at a low level.
This repository explores advanced concepts in assembly language, focusing on making system calls and interacting with the OS directly. It includes practical examples that demonstrate how to:
Before running the examples in this repository, ensure you have the following tools installed:
git clone https://github.com/kavicastelo/assembly_system_calls_and_interacting_with_os.git
ccd assembly_system_calls_and_interacting_with_os
PATH
environment variable.This exercise demonstrates how to make a basic system call to print a message to the console.
ex1/EX1.asm
This exercise shows how to read a file using system calls and print its contents.
ex2/EX2.asm
This exercise explores process management, including creating and managing processes via system calls.
ex3/EX3.asm
To assemble and link the examples, follow these steps:
nasm -f win64 <filename>.asm -o <filename>.o
gcc -m64 -o <filename> <filename>.o -lkernel32 -lmsvcrt
.\<filename>.exe
Replace <filename>
with the specific example you are running.
Contributions are welcome! If you have any suggestions, bug fixes, or improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.