🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

detecting (hardware) resources

Started by
33 comments, last by Calin 4 years, 4 months ago

So basically Bios was/is the first eye that never sleeps.

My project`s facebook page is “DreamLand Page”

Advertisement

Calin said:

So basically Bios was/is the first eye that never sleeps.

I hope this was a bad Google translation.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

no, just expressing my thoughts out loud

My project`s facebook page is “DreamLand Page”

I think, different OS has different method to query.

  • In POSIX-based like Linux or BSD, you can basically check the `/dev` path for devices.
  • In Windows-based, you'd need to use some WIN32 api, based on different hardware-types you're querying for.

May be you can check some of the opensource software that do this kind of things (including MESA perhaps?).

PS. I don't think ther's too many thing you can do using/with BIOS (using interupts?). Haven't tried though….

http://9tawan.net/en/

NikiTo

So the CPU execution mode is something only the CPU and RAM deal with. Like the Bios knows how to address the video adapter even though its a low level OS.

My project`s facebook page is “DreamLand Page”

mr_tawan said:
Linux or BSD

Is the hardware manufacturer providing a different set of drivers for each OS? Like if I make an amateur OS I will never be able to use the HDD because no one will provide me a driver made for me (my OS).

My project`s facebook page is “DreamLand Page”

Different CPU modes require different programming languages.
Only programs written for 32 bit mode will run on 32 mode.
Only programs written for 64 bit mode will run on 64 mode.

Let say it this way - there are three different ASM languages.
ASM for 16 bits.
ASM for 32 bits.
ASM for 64 bits.

Every time you want to code something, you need to change the state of the CPU. In order to execute 256 bit instructions, you need to change the state of the CPU again.

The manufacturer knows how to program for the GPU and HDD. This is why the manufacturer provided BIOS with the drivers. But these are basic drivers. Later, the OS will connect to the manufacturers again and download the ultimate drivers.

Yes, drivers are the biggest problem for hobbyist OSes. BIOS gives you the most basic GPU driver. It can put a colored pixel on the monitor. BIOS can not use Compute shaders. For that you need to download the final driver from the website of the manufacturer of the GPU.

Google for “ASM bootloader tutorial” it will make it all clear for you. You need a LOT to read IF you want to deal with ASM. A LOT to read!!!
Take the PDFs about ACPI and read them entirely. The manuals of Intel are thousands of pages long.

I can give you a short hint, but you have to do your homework.

If OS is too big for you, a very good exercise is to program a compiler. It can help you learn ASM and you will learn a LOT of super useful things.

This is what a quick search on Google gave me:
https://norasandler.com/2017/11/29/Write-a-Compiler.html

NikiTo said:
You still can use routines offered by BIOS

k, so BIOS provides basic functionality, I can use BIOS to load data from a FlashDrive and display text on a blue screen. However if I want to use directx/run the video adapter in high gear I need to load Windows. So if I want to use directx and windows my ASM program needs to operate in 32 bits mode or higher.

My project`s facebook page is “DreamLand Page”

If you want to use DirectX you need Windows. DirectX is Windows. You don't need to know nothing about the driver implementation if you are going to call DX from ASM on a Windows.
What you need to know is how DX works.

(If you feel lonely and need to talk to somebody, try discord. I don't know if the discord of Gamedev is still alive. There was an ASM community on G+, but it moved somewhere. And there are forums about OS development that are still active. About drivers and OS, ask there.)

NikiTo said:
You don't need to know nothing about the driver implementation if you are going to call DX

that`s not what I`m concerned about. I`m trying to imagine how the setup will work. I`m looking for a minimalist setup. Running my ASP with the least number of libraries alongside. like If could get by by not using Linux or Windows, I would do it. I understand that after compiling it`s just a fabrique of code machine instructions between devices.

My project`s facebook page is “DreamLand Page”

This topic is closed to new replies.

Advertisement