Handmade Hero»Forums»Game
217 posts
Discussion about OS and game relationship
Edited by longtran2904 on Reason: Initial post
I've just watched "The Thirty Million Line Problem" and there's something that I haven't understand:
1. Games only need to talk with OS when they need to a) open a window/work with UI-related tasks and b) work with the file system (saving/loading files), right? Most of the time they just talk directly to the hardware (cpu, gpu), so if I write code for x86 then I don't need to care about what OS the user will use.
2. Most of the OS's jobs are just storing/choosing different drivers, supply the user with some UI system, having some sort of bootloader, file system, VM/memory protection, and sata/usb interface. What's so complex about making an OS that it needs 30 million loc?
511 posts
Discussion about OS and game relationship
1. you don't talk to gpus directly, instead you talk to the gpu driver through a standardized API

2. there are many variation of the hardware, and the OS provides a unified view of it. Even just a file has a dozen ways it can be accessed on a hardware and driver level, between USB mass storage, SATA, PCIe mass storage, network attached drives, etc. All of those get a single API to read and write them.
217 posts
Discussion about OS and game relationship
But making an ISA for gpu and cpu would only solve the first one, it wouldn't help other hardware (like keyboard, mouse, USB, etc).