In / out assembly instructions and devices
In / out assembly instructions and devices
Hi,
I am not sure about a thing.
Say I have a sata hdd, a ssd, a usb key, a pci-e graphic card, a usb keyboard and a x86_64 architecture.
Apparently, the devices are all memory mapped.
So, is it correct to assume that I will never use in/out instructions on hardware 2011+ old (except on boot with the a20 gate and other legacy things)?
Bye
I am not sure about a thing.
Say I have a sata hdd, a ssd, a usb key, a pci-e graphic card, a usb keyboard and a x86_64 architecture.
Apparently, the devices are all memory mapped.
So, is it correct to assume that I will never use in/out instructions on hardware 2011+ old (except on boot with the a20 gate and other legacy things)?
Bye
-
- Member
- Posts: 1146
- Joined: Sat Mar 01, 2014 2:59 pm
Re: In / out assembly instructions and devices
I believe that that is true, yes. But remember that you will need to write a driver; there is no simple way to do input and output via e.g. pci devices.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Re: In / out assembly instructions and devices
I wouldn't go that far. I'd be suprised if you can build a whole kernel with no in/out instructions. I think OHCI USB controllers are I/O based, at least partially, so avoiding it entirely may be out of the question.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: In / out assembly instructions and devices
I really like to ask extreme questions
So, how may I know if and when I need those instructions?
Rule of thumb or something?
So, how may I know if and when I need those instructions?
Rule of thumb or something?
-
- Member
- Posts: 5588
- Joined: Mon Mar 25, 2013 7:01 pm
Re: In / out assembly instructions and devices
The hardware documentation will tell you when you need to use port-mapped I/O.
Re: In / out assembly instructions and devices
In most cases, a flag in the PCI device's configuration space determines if the device uses memory addresses or I/O addresses.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Re: In / out assembly instructions and devices
Great,
Thanks !
Thanks !
Re: In / out assembly instructions and devices
Unless everything is PCI-e you will still need to use I/O ports.
Re: In / out assembly instructions and devices
As far as I recall the ACPI SMI_CMD port can only be an IO port, thus you'd need at least one out instruction to switch to ACPI mode.
Regards,
John.
Regards,
John.
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: In / out assembly instructions and devices
Some DMA and NICs are based on I/O ports. ACPI is based on I/O ports. You will still need them in your kernel, even if they are rarely used.
You know your OS is advanced when you stop using the Intel programming guide as a reference.