Resources for socket programming and low level programming in Windows

Hello Members,

About:
I am a beginner in programming. I learnt most of the things by reading books or reading online.
I have recently learnt few basic topics in C and after I learn the advance topics like Structure, data structures, etc I will start learning C++. I am using Dev C++ in Windows platform.

My plan:
After learning basics of C/C++, I want to learn the following subjects and practice as well using C/C++.
1. Computer networks, IP and other protocols
2. Memory, computer organization, Embedded systems, low level programming, interacting with hardware including microcontroller
3. Compiler design. (Hopefully there are some books on this subject with me)

Since, most of the resources online for the above mentioned topics (1 and 2) are based on Linux, I couldn't understand how should I learn them in Windows. I like and respect Linux but I want to do it in Windows itself. I am ready to change the compiler though if that's convenient.

Questions:
1. Which libraries should I use for socket programming (or anything involving computer networks)?
2. Any good resource to learn low level programming using C/C++? I mean I want to learn to interact with the hardware, and eventually go on to write device drivers for any device.

Please provide me guidance.

NB: It's probably easy in languages like Python or JavaScript to learn computer networking. But I want to stick completely to C/C++ only. :)

Thanks in advance. Regards
Computer networks, IP and other protocols
Networking is a fairly large subject. What exactly do you want to learn about it? You mention IP. Again, what about it do you want to learn? How to use it? How to construct valid IP packets and send them over Ethernet?

Memory, computer organization, Embedded systems, low level programming, interacting with hardware including microcontroller
The mention of "microcontroller" confuses me. Do you perhaps mean "microprocessor"? A microcontroller is not really part of any computer you have normally access to (or at least, not in such a way that you can program it).

Any good resource to learn low level programming using C/C++? I mean I want to learn to interact with the hardware, and eventually go on to write device drivers for any device.
I get the feeling that maybe you have some kind of romanticized idea about what writing drivers is like. Drivers are mostly bookkeeping and dealing with IRQLs. It's not really more exciting that usermode programming, there's just more ways to screw up.
You say you want to interact with the hardware. What sort of hardware, specifically? A GPU and a printer are quite different. Also, what makes you think you need "low level programming" to do this?
I think maybe he has confused devices ON a real computer and embedded computing.

Embedded computing is for small computers; some so small they lack a real operating system and are little more than a programmable chip, and others that are full computers on par with a high end phone or better. The ones that are like a computer are programmed just like a computer for the most part. The little ones are a mixed bag of accepting real c++, a subset of it, an extension of it, or only C for some. As often as not your tools for such things have a library routine that says "put 3.25 volts on this wire" or "emit this integer on this port". A lot of the 'learning' comes from 'doing' in that you have the system in hand and you read the manual and examples for it and figure out how to make it work. Each one is different, though they are also each similar in many ways. There are inexpensive systems you can buy to learn enough about these things to do a lot -- and many a hobbiest codes for them with minimal software engineering skills / background so its very doable on your own these days. Google arduino and find yourself a little starter kit.

as far as networking, it is done to death. You may be able to find an older hands-on library like the ancient winsock library for windows (it was more down in the details than modern tools, so for learning it could be helpful), or it may be so far gone that you can't use it anymore, I do not know. Regardless, the web is your friend here.
try starting here, with the latest microsoft compiler, or find a unix resource if you want.
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/socket-code-examples

I dont know much about drivers; the last one I did was for windows 98 and all it did was fool the OS into thinking the (dos era) device was legit enough that it would stop screwing up and trying to use its data stream as a mouse.

plenty of info on compiler design too. The basics are simple; there is a thread in here somewhere for people making a very simple compiler as a project. The advanced ideas get hairy fast, though .. writing a machine that turns code into very efficient executable programs is an art, and the hardware is always changing so the tricks to make the best product are also always in flux.
Last edited on
@Helios First of all, I am very grateful for the reply :)
My apologies if I wrote very ambiguous terms.

Networking is a fairly large subject. What exactly do you want to learn about it? You mention IP. Again, what about it do you want to learn? How to use it? How to construct valid IP packets and send them over Ethernet?


1. I have read a book called Computer Networks by A. Tanenbaum. He has discussed a probably hypothetical five layer model. In practise, I think the 4-layer TCP/IP model and the OSI model are used. I am not sure. So, I want to learn the layers, workings, etc.

Also, I am interested in learning how various protocols work. (HTTP, Telnet, FTP, etc etc)

2. Yes, IP packets too, I guess.

The mention of "microcontroller" confuses me. Do you perhaps mean "microprocessor"? A microcontroller is not really part of any computer you have normally access to (or at least, not in such a way that you can program it).


Sorry, yes, microprocessor.

What sort of hardware, specifically? A GPU and a printer are quite different. Also, what makes you think you need "low level programming" to do this?

I have read in K&R's C programming language that by default C doesn't have any input/output functions. So, I was curious what is the general idea to read from keyboard or display it in the monitor when you don't have the io header. Maybe, I would want to start by understanding how to write a function that interacts with the keyboard and the monitor at first. I have read a bit about pointers and I understood that through it I can get "memory locations" (guessing) but how to interact with keyboard or the desktop.
So, I want to learn the layers, workings, etc.
So basically just general knowledge? Have you checked Wikipedia?
https://en.wikipedia.org/wiki/OSI_model

Also, I am interested in learning how various protocols work. (HTTP, Telnet, FTP, etc etc)
What do you mean how they "work"? A protocol doesn't do anything, it's an agreement between two parties on how to conduct a transaction.
If you want to learn the protocols themselves, read the RFCs. It's really not an interesting read unless you want to implement a client or a server, though.
HTTP:
https://tools.ietf.org/html/rfc1945 (1.0)
https://tools.ietf.org/html/rfc2616 (1.1)
https://tools.ietf.org/html/rfc7540 (2.0)
Telnet:
https://tools.ietf.org/html/rfc15
https://tools.ietf.org/html/rfc855
FTP:
https://tools.ietf.org/html/rfc959

Sorry, yes, microprocessor.
Well, the processor is what executes your program, so anytime your program is running you're in direct control of the processor. So I don't know what you might mean by "interact with the processor". It's not a device that you can send commands to.

I have read in K&R's C programming language that by default C doesn't have any input/output functions. So, I was curious what is the general idea to read from keyboard or display it in the monitor when you don't have the io header.
K&R wrote that book in the 70s when they were designing C and UNIX for the PDP-11, a 16-bit minicomputer (i.e. roughly the size of a refrigerator). It's not intended to describe how computers will work from then until the end of time.

It's true, as languages C and C++ don't have any way to do I/O. That functionality is provided as libraries, i.e. collections of functions. Simply put, the OS exposes functions which the program can use to interact with the system at various levels. For example, in UNIX open() can be user to create a file in the current directory, or to open the disk itself (the OS exposes it as a file in /dev). In Windows, CreateFile() fullfills a similar function. Interestingly, these functions can also be used for things that are obviously not storage, such as pipes (inter-process communication objects) and network connections.

Maybe, I would want to start by understanding how to write a function that interacts with the keyboard and the monitor at first. I have read a bit about pointers and I understood that through it I can get "memory locations" (guessing) but how to interact with keyboard or the desktop.
Simple console I/O can be performed with the functions in <iostream> in C++ and in <stdio.h> in C. Modern computers are not the Commodore 64. You will get nowhere trying to write bytes to random memory addresses, you'll just crash your program.
Topic archived. No new replies allowed.