by pan69 · 17y ago · 0 comments
First read "Code" by Charles Petzold. This book will get you "in the mood" and in the right frame of mind: http://www.amazon.com/Code-Language-Computer-Hardware-Softwa...
Then I suggest you pick up a good book on Assembler. This might be a good choice: http://www.amazon.com/Professional-Assembly-Language-Program...
Start writing some drivers for Linux. Like a memdrive or something. Do it all in Assembler! Oh, you need to read other books on how to do this...
Then pick up the K&R book on C. Now write your memdrive driver in C.
That should get you started. I think it will take you at least up to two years before you're passed the learning curve and to be comfortable with this level of programming.
Oh, you need to be willing to do it for the love of it because it's highly unlikely that you will make a living using these sort of technologies (nowadays).
Good luck!
PS: I miss the old days...
Low level assembly is what you want, that presumably includes interfacing with you favorite C code.
Calling conventions, stack frames and so on.
Besides, the boilerplate runtime stuff has nothing to do with writing kernel code, so a 'trivial hello world' program will have a lot of cruft added to it:
.file "hello.c"
.section .rodata
.LC0:
.string "helo, world!"
.text
.globl main
.type main, @function
main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $20, %esp
movl $.LC0, (%esp)
call puts
addl $20, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size main, .-main
.ident "GCC: (Ubuntu 4.3.3-5ubuntu4) 4.3.3"
.section .note.GNU-stack,"",@progbits
that's not that bad.Note the stack frame alignment trick, the fact that 'printf' was specified in the source but puts is being called!