Page 1 of 1 [ 2 posts ] 

kmalloc
Hummingbird
Hummingbird

User avatar

Joined: 10 Dec 2013
Age: 34
Gender: Male
Posts: 21

20 Feb 2014, 2:01 am

I would like to learn x86 assembly on 32-bit linux with the NASM assembler. Where do you start off on linux other then a basic hello world program? Also, where can you find a good list of system call numbers for linux, if I'm not mistaken?

(note: I have some knowledge from art assembly text. I don't have much experience.)



one-A-N
Veteran
Veteran

User avatar

Joined: 2 Mar 2010
Age: 70
Gender: Male
Posts: 883
Location: Sydney

20 Feb 2014, 6:03 am

System call numbers with registers used (2.2.x kernel): http://docs.cs.up.ac.za/programming/asm/derick_tut/syscalls.html

and http://syscalls.kernelgrok.com/ for 2.6.x kernels.

These will probably work for some simple code while you hone your assembly skills.

Using just sys_read, sys_write, and sys_exit you can write a whole lot of command line filters if you feel so inclined. Perhaps even a simple compiler that turns a higher level language into NASM code.

Then again, you might need to learn sys_brk in order to implement your own version of malloc (or copy the ideas behind talloc for a better memory manager).