4 ms·
Some things I'm glad to have done: 1. Write a Hello World application from scratch. No C library, compiler, linker, nothing. You get a hex editor. 2. Write
by drblast 16y ago
Some things I'm glad to have done:
1. Write a Hello World application from scratch. No C library, compiler, linker, nothing. You get a hex editor.
2. Write a non-bootstrapped compiler or interpreter using assembler.
3. Write a program that learns to play a game.
4. Develop a network protocol.
5. Write a web server. You can use the language of your choice, but nothing is allowed except a socket library.
6. Write a platform game that performs at least as well as the original Super Mario Brothers.
7. Design a circuit that has some sort of non-trivial purpose and build it.
8. Write Tetris in Javascript.
- niktech 16y agoYou can also take 1. to the extreme and write a mini-OS from scratch. Bootloader and all. http://news.ycombinator.com/item?id=1605119 http://news.ycombinator.com/item?id=1605119
- jrockway 16y agoOrthogonal. They are using gcc there, which is not the same as his #1.
- jrockway 16y ago1. Write a Hello World application from scratch. No C library, compiler, linker, nothing. You get a hex editor. Does this involve anything more than loading "Hello, world" into memory, setting up the registers/stack in a certain way, and invoking the syscall interrupt? (All the cool stuff happens in your terminal emulator. That's where 0x41 gets turned into the pixels that look like "A" on your screen, after all.)
- angusgr 16y agoAt least part of the "fun" on a loosely modern operating system is learning the nuts and bolts of the executable format and loading conventions. I've never spent much time there, but some of the ideas are laid out well in this two part post: http://blog.ksplice.com/2010/04/libc-free-world-2/ http://blog.ksplice.com/2010/04/libc-free-world-2/ Doing it with _just_ a hex editor (ie writing out the ELF headers and sections yourself) may not be exactly what the commenter did, though. Cos that sounds really tedious. I imagine that even writing "Hello, World" in the simpler way that you describe, on a simpler system (Apple IIe or so), would probably teach me something. I remember trying to write 6502 machine code in hex (no assembler) on my IIe when I was about 10 years old. It never worked then, I wonder if it would work now?
- drblast 16y agoIt's not that difficult or tedious, but it does require that you read the elf specification, or write your own "OS" from scratch. http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html http://www.muppetlabs.com/~breadbox/software/tiny/teensy.htm... The idea is that you strip away everything that does something for you so that you are sure to completely understand the entire process with no "pushing the green compile button."
- derefr 16y agoWrite it for a system that doesn't have a terminal (or a character mode.) A Super Nintendo (65c816 CPU with the most thoroughly-tested emulators on the planet), say.
- jrockway 16y agoThen it's just setting some bits in the video memory to "on".
- dgulledge 16y agoA variant on 4 that I've been meaning to get to for a little while now is to implement the same network protocol in several languages.
- scorpion032 16y ago> Write a Hello World application from scratch. No C library, compiler, linker, nothing. You get a hex editor. "To prepare a donut from scratch, you have to first create the universe."
- bingaman 16y agoSame with apple pie.