11 ms·
Brushing up on operating systems and C programming
- zabana 9y agoSomewhat unrelated but I've always wanted ask: What types of small projects can a beginner start to develop a better understanding of C ? (Beyond basic syntax, something that would actually make use of memory allocation, pointers etc)
- AlphaSite 9y agoCreating a small UFS implementation (on top of your file system, rather than as a raw disk is probably easier) in C is a nice fun exercise.
- zabana 9y agoThanks for the recommendation ! Sounds indeed like a fun thing to do.
- yeukhon 9y agoA small kernel. I think it’s always good to start with implementing data structure and algorithms... If you want C++, try help out Firefox’s codebase. I did and it was a very rewarding experience. (Linux kernel project is hmm... just harder to get involved IMO).
- server_bot 9y agoThe best guided project/intro I've seen for complete beginners is Daniel Holden's "Build Your Own Lisp". It's a free online book that walks you through writing a Lisp interpreter (something worthwhile even for experienced C programmers!): http://www.buildyourownlisp.com/ http://www.buildyourownlisp.com/
- csnewb 9y agoI recently decided to review operating systems, but my old Tanenbaum textbook from college would take forever to read through especially now that I'm working full time. I've been watching the Berkeley lecture series on Youtube (CS 162) and its been pretty good at covering the main topics concisely.
- monaghanboy 9y agoWhat prompted you to review? Does this somehow indicate that you weren't using the course material in your job(s)?
- csnewb 9y agoI graduated from college more than 2 years ago so I forgot almost all of them CS topics that I've learned and wanted to review the fundamentals (OS, databases, computer architecture, etc). And no, I don't use of these concepts very much at work, only surface level knowledge. I've also been trying to learn more about malware analysis and reverse engineering, and it seems like having a solid foundation in CS concepts is key to being proficient at it.
- monaghanboy 9y agoWould you mind sharing what kind of software you write? This is interesting to me, since I'm self-taught and seem to have done well in my career so far (4 years in), but now I'm going through core CS books and courses, worried that I'll hit a ceiling and wanting to fill the gaps in my knowledge. I work in devops and infrastructure.
- partycoder 9y agoThis book is not about OS dev but rather systems programming: "The Linux Programming Interface", https://nostarch.com/tlpi https://nostarch.com/tlpi For OS development resources, this wiki is very good: http://wiki.osdev.org http://wiki.osdev.org
- CandidlyFake 9y ago> This book is not about OS dev but rather systems programming: "The Linux Programming Interface", https://nostarch.com/tlpi https://nostarch.com/tlpi You can also look through the man pages for free. https://www.kernel.org/doc/man-pages/ https://www.kernel.org/doc/man-pages/ Or if you are adventurous you can play around with syscalls in assembly. https://syscalls.kernelgrok.com/ https://syscalls.kernelgrok.com/ Also, the examples for TLPI are available online http://man7.org/tlpi/code/online/index.html http://man7.org/tlpi/code/online/index.html
- da_chicken 9y agoNot to pick on you specifically, but I've really grown to hate this type of response to this very common question. Most people new to a topic want an instructional manual or guide, not a technical reference. Man pages and tables of syscalls are decidedly the latter, and therefore primarily intended for people who are already familiar with the topics they cover.
- CandidlyFake 9y ago> Most people new to a topic want an instructional manual or guide, not a technical reference. Man pages and tables of syscalls are decidedly the latter, and therefore primarily intended for people who are already familiar with the topics they cover But this thread is about brushing up on OS and C programming. So not novices, but people who are already familiar with the topic.
- danieldk 9y agoEven then... Where are you going to start in reading references? A random syscall or function a day? I think it is far more useful to e.g. read the late W. Richard Stevens' Advanced Programming in the Unix environment. It puts everything in context, provides historical background where necessary, and gives examples. Reference pages are not really for brushing up, but more for the 'what was the address family field of sockaddr called again'-type of questions? Or put differently: they are external memory.
- dhuramas 9y agohttp://pages.cs.wisc.edu/~remzi/OSTEP/ http://pages.cs.wisc.edu/~remzi/OSTEP/ is really good and approachable. It was even recommended in one of the Gatech OS courses.
- monaghanboy 9y agoI've gone through the first few chapters of this book, it's fine. The exercises are somewhat lacking though, in my opinion (the last course I did was nand2tetris, which was project-based, so perhaps I have unrealistic expectations). I started learning C concurrently, and didn't find it a problem.
- django1993 9y ago+1 for OSTEP
- 3uclid 9y agoUniversity of Waterloo also recommends Three Easy Pieces as a supplementary text for their OS course.
- teeray 9y agoCan anyone recommend an intermediate to advanced C book? I feel like most C material I've been exposed to in the past lacks what a modern C project should have when it comes to best practices, code organization, build tools (should I use make for this, cmake, where does autotools fit? what about clang vs gcc?), linters (valgrind?), testing, etc. I recognize that much of this falls outside of C, but all of these tools seem like things C projects routinely grapple with.
- deleted 9y ago[deleted]
- crispinb 9y agoYou could take a look at Ben Klemens’ 21st Century C from O’Reilly. It covers that precise territory. I can’t recommend it as I haven’t read it yet — it has been on my eyes-bigger-than-my-time-and-energy book pile for a couple of years.
- fipar 9y agoI really liked this one: http://shop.oreilly.com/product/0636920033677.do http://shop.oreilly.com/product/0636920033677.do (21st century C, in case the link is wrong as I’m on my phone now)
- a3n 9y agoSecond.
- monaghanboy 9y agoI would recommend https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504 https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/.... There's specifically a section on organizing large projects IIRC.
- fellellor 9y agoThis is a very thorough, detailed book on the topic. It's pretty awesome.
- deleted 9y ago[deleted]
- sifoo 9y agoWill recommending my own project get me hell-voted? Cixl is a straight forward 3-stage (parse/compile/eval) interpreter that is designed to be as fast as possible without compromising on simplicity, transparency and flexibility. The codebase has no external dependencies and is currently hovering around 7 kloc including tests and standard library. There are some articles explaining design decisions, but I've been mostly busy with code. The code should be perfectly readable though, and contains plenty of good ideas distilled from 32 years of daily practice. https://github.com/basic-gongfu/cixl https://github.com/basic-gongfu/cixl https://github.com/basic-gongfu/cixl/tree/master/devlog https://github.com/basic-gongfu/cixl/tree/master/devlog
- Bjartr 9y agoCould make a good show hn post
- sifoo 9y agoBeen there, done that :) https://news.ycombinator.com/item?id=16081592 https://news.ycombinator.com/item?id=16081592
- akkartik 9y agoYes I followed that thread with interest, as well as the earlier one on Reddit. I still have trouble following many of your statements, though. Here, are you saying the Cixl implementation is a useful example of C programming? Or something else?
- brett40324 9y ago> contains plenty of good ideas distilled from 32 years of daily practice Wow, okay im sold. And to think that i thought i was getting good after a few years.
- git-pull 9y agoI recommend (by most expensive, to free): Marshall Kirk McKusick's FreeBSD Intensive Code Walkthrough: https://www.mckusick.com/courses/advdescrip.html https://www.mckusick.com/courses/advdescrip.html Also, The Design and Implementation of the FreeBSD Operating System (2nd Edition): https://www.amazon.com/Design-Implementation-FreeBSD-Operating-System/dp/0321968972 https://www.amazon.com/Design-Implementation-FreeBSD-Operati... Thirdly: grab a copy of FreeBSD (or OpenBSD) and (a) set it up in VirtualBox and SSH it into locally (b) use an old ThinkPad. Then grab the source code of the base system. Build and install it. And start reading code of things like usr.bin/grep/grep.c
- antoncohen 9y agoI have't done the code walkthrough course, but I bought and watched Kirk McKusick's Kernel Internals course and it is excellent (https://www.mckusick.com/courses/introdescrip.html https://www.mckusick.com/courses/introdescrip.html). It is based around FreeBSD, but is a generic enough Unix internals course that it is good for Linux. I'm thankful to have the opportunity to learn from someone with such deep knowledge of Unix, who was involved with BSD from the early days in the 80s to modern FreeBSD.
- lettergram 9y agoI personally found the best method of brushing up on C and operating systems was just walking through examples myself... Haven't personally done it for a few years, but I went through step by step on my blog (particularly in 2014): https://austingwalters.com/knowledge/ https://austingwalters.com/knowledge/ I also have a nice repo of a bunch of IPC examples: https://github.com/lettergram/IPC-examples https://github.com/lettergram/IPC-examples
- orsenthil 9y agoCS50 courses (This is CS50!), cs50.io is currently one of the easiest and the best introduction to C language. It's very modern approach to teaching C programming.
- django1993 9y agoI would also recommend reading Computer Systems: A Programmer's Perspective, 3rd Edition.
- server_bot 9y agoIndeed! It's my favorite technical book, several of the chapters have information I've yet to find laid out in comparable detail anywhere online. The book was written for a CS course (15-213) at Carnegie Mellon University, course materials here (supplement, but no replacement for the book): https://www.cs.cmu.edu/~213/ https://www.cs.cmu.edu/~213/
- andlrc 9y agoTLPI is a fantastic reference book to have when written code.
- beeforpork 9y agoTo learn which traps to avoid in C, have a look at SEI CERT C. It's written very well with examples and explanations, and is structured as a coding guide. https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Coding+Standard https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Cod...
- beeforpork 9y agoKnowing and fully understanding the concept of undefined behaviour (UB) and the difference to unspecified and implementation-defined behaviour is a must for safe and secure C programming. Because arguably, C and C++ are broken at the specification level. Chris Lattner puts this in kind words: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
- coreyR11 9y ago◾ "PROTOCOL SHIELDERS" ◾ Hello, I am COREY RODRIGUEZ by name, THE CEO of protocol & cyber-sheild hackers. In this message, we will explain how you can almost avoid SCAMMERS and stay safe, plus how our organisation works. Read it carefully!! Its reading will not take more than 10mins. We kindly URGE you to not respond without have read the entire text. Those who mail without have read everything, ask questions that are answered here!! WARNING: MOST HACKERS YOU SEE HERE ARE FAKES AND INCONGUROUS!!. It tears me up when we receive bitter emails for Jobs with complains from most clients with hacking issues about past SCAMs by uncertified fake hackers like most you see here, which is disappointingly inadequate, leaving their mess for us to deal with eventually (WE DON'T MEAN TO BRAG ABOUT THAT). HOW WOULD YOU KNOW?? You won't know until you fall a Victim but can be attentive to potential danger, error or harm if you take note of these: 1, you see uncertified email accounts carrying numberings like "iamhacklord1232@(gmail,yahoo or hotmail.com" pls flee from them, BIG SCAMMERS. They take your money and never do your job!! 2, you see posts like "do you need to spy on spouse?" All fake! , just a way to lure you toward getting ripped OFF!. 3, posting fake testimonies and comments to trick you into feeling save and secured. Pls endeavour to ignore!! ◾VERY IMPORTANT◾ For years now, We've helped organisations secure data base, so many sites has been hacked for different reasons of Job kinds. "CLEAR CRIMINAL RECORDS" & "iPhone HACK" of and in short timing hacked petty cyber sites accounts like Skype, Fb, WhatsApp,Tinder,Twitter!!, FLIPPED MONEY, LOAD CCs and vice versa but these are significant experiences a good and effectively recognized organisation must firmly ascertain. ◾OUR "AIMS" HERE◾ Are: 1◾to assign a qualified agent of specific rank to particularly any sort of cyber issues you intend dealing with in short and accurate timing. 2◾ to screen in real hackers (gurus only) in need of job with or without a degree, to speed up the availability of time given to for Job contracts.!! Thus an online binary decoding exam will be set for those who seeks employment under the teams Establishment. write us on: ◾Protocolhacks@gmail.com or ◾Cybershieldnotch@gmail.com ◾Cybershieldnotch@protonmail.com, COREY ROD, SIGNED...! Thank you!!!
- b3h3moth 9y agoGreat 'free' resources: - C Programming Boot Camp https://www.gribblelab.org/CBootCamp/index.html https://www.gribblelab.org/CBootCamp/index.html - aalto-c.mooc http://2016-aalto-c.mooc.fi/en/Module_1/index.html http://2016-aalto-c.mooc.fi/en/Module_1/index.html
- stiff 9y agoI like this little book, in very small amount of space it teaches you how to build a bare bones OS, from there you can start doing your own experiments which I think is the best way to really learn something: https://littleosbook.github.io/ https://littleosbook.github.io/ It's good to not only know operating systems in general, but also to understand some of the internals of the operating system you are actually using. For Linux, this is good: https://0xax.gitbooks.io/linux-insides/content/index.html https://0xax.gitbooks.io/linux-insides/content/index.html
- swinghu 9y agomark as it is ,learned a lot