Special programs the OS runs that can talk to hardware that know the rules for specific hardware devices.
Need an operating system, or you would have to write every computer program starting with CPU language.
Operating systems began to emerge in the 50s/60s.
Multi-user system that can run multiple programs at once.
Operating system is the brains of your computer.
Microsoft Windows: Bill Gates and friends made a pretty well-executed copy of an operating system that was hard to get and understand and sold it to everybody.
Two variants of PC operating systems that you'll see in people's hands:
There's a third operating system that is of great, great importance, called iOS that is not Windows or Linux.
If you're using a Mac for development, it's not Linux, but it's POSIX.
Reason Windows has slipped in popularity: It was designed stupidly in the beginning (feature): Easy to use and quick
Few principled technologies that OS provide:
OS is the reason your system can run multiple programs at the same time.
"The Process Scheduler" swaps each program out on a schedule.
The youngest process ID is the oldest living system - the one that has to run everything else.
Two of the lowest level systems in the OS
Windows did not have a permissions model at all in the 80s/90s - loaded files into memory with no problem.
If you want to be a Windows programmer:
Worst thing about developing for Windows: when you want to write a new program, you have to give it compatability mode commands that go through all the other versions of Windows. So just building a basic program in Windows involves referencing the Windows 98, NT, ME, etc. sourcebases and configuring it to work in all those environments separately.
Compared to the Apple technique -> just to break your computer (there being a point where technology no longer works on older machines).
Linux based on UNIX -> ran on mainframes, faxes, building-sized systems, and was developed by academics in a closed environment to do everything an operating system should.
Programs can communicate with each other through files and streams of data side to side.
Windows communication is done mostly through the registry (a catastrophe).
C programming language is all about configuring your program before it gets compiled so it works on the plaform that you're trying to build it for.
If you don't have the same system, you do meta programming, build configuration, and you don't program in C until you work out the gimicks.
For doing cross platform C development, 80% of the work is platform compatability and 20% is writing the thing you want to share with people.
Question: Will we be doing things you can't do in Visual Studio?
Yes.
Biggest challenge of trying to use Visual Studio on Windows is that the system calls 'do not intersect' with the Linux system calls.
For 20 years, Windows has been trying to copy Linux's system calls.
Example, sockets didn't exist in Windows and they made a copy of BSD sockets called winsock that was marginally well implemented and has been the bane of tens of thousands of developers in that you can't write a program in C that talks to the Windows operating system and the Linux operating system.
You can meta program, you can manipulate the program so it writes a different program on Windows vs Ubuntu but will not write the same program.
Question: How does not building the hardware with the software affect Windows vs OSX?
It affects the quality of the experience.
Windows builds the operating system and then tells vendors (people who build hardware) how their hardware needs to work in order to work on Windows. And then Windows has a multi-billion dollar certification lab for testing the hardware that people want to sell to make it Windows certified. Because it's a free market, you don't have to get your Windows stuff certified. You can make your driver, etc and release it to the public and sell it and it might work or might not work.
C Software Assembly language Binary wire commands
A high level programming langauge that converts human thought structures into assembly langauge.
The human representation of wire commands that go to the CPU
Below the assembly language it turns into the machine code that does go to the CPU
CPU does bit flipping BIOS finds the harddrive, loads the master boot record from the harddrive
When you run OSX, there's a block of drivers. Many written by Apple to control the harddrive, wifi, touchpad, etc.
Each driver is a C program that knows the precise language of a specific piece of hardware.
When that driver program gets loaded by the kernel, it enables the CPU to handshake with that hardware and receive input/output from it
On Windows: Package with 50,000 or 100,000 drivers, etc. 700 drivers for NVIDIA video cards. Drivers essentially become another program that the OS schedules.
Execute processes and schedule them Manage their memory and the rest of the memory in the system Provide access to and execute drivers that can control hardware Create a file system for addressing long term storage and loading files such as drivers and executable processes from them.
Kernel is the core of the computer - alpha program
Kernel keeps a proces list inside of it. It runs a closed loop: Most basic operating technique in any computer is a loop that says while true.
Any long-lived program that you write tends to be inside of a while loop. Any program where the input and output are undefined and could be anything at any time.
That's what the kernel does.
Probably, it has a setup block before the while loop.
During setup, load the disk drivers so we can read the disk. Then, create a memory map of all the memory in the system (what's available and what's been assigned to who). Load the process scheduler program. Load the memory manager Load the user agent Load the file table
Put the memory addresses for the memory management program into the list of the entire memory in the sytem - do that for user agent, file table, etc.
While true, load the next program
There's a list containing all of the processes that have been loaded.
Inside of the while loop, the OS comes online and says now that the basic systems have set up, execute them in turn
From the process list, pop the currently executed item.
And it's probably not going to keep it as an stack, it'll have an array and a pointer at the index
Going to load at the index and execute it.
From the beginning: BOOT -> Power on Self Test (POST)->BIOS-> MBR -> Initial kernel
Operating system kernel-> kernel system processes-> load programs for:
Firmware programs that check memory is present, there's a long-term storage available, and graphics are available
Launches operating system from the boot record
Master Boot Record
Read a file Write a file Allocate memory for a process Destroy memory Write data to a driver Create a new process Kill processes
[https://imgur.com/a/l3uLfiL]