<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.friendos.dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TheCatgirls</id>
	<title>FriendOS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.friendos.dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TheCatgirls"/>
	<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php/Special:Contributions/TheCatgirls"/>
	<updated>2026-06-01T10:30:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=114</id>
		<title>Intel 64 Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=114"/>
		<updated>2025-07-12T02:53:31Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: /* 64-bit Mode */ - fixed an unconverted italics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Architecture =&lt;br /&gt;
&lt;br /&gt;
The Intel 64 Architecture is a 64-bit extension of the 32-bit [[x86]] [[IA-32]] architecture. It was introduced around 2004, reimplementing [[AMD64]], AMD's 64-bit extension.&lt;br /&gt;
&lt;br /&gt;
Both [[AMD64]] and Intel 64 Architecture (from henceforth referred to as I64A; Do not confuse with [[Itanium]], referred to as [[Itanium|IA64]].) are collectively referred to as [[x86_64]], and commonly as [[x86_64|x64]], or [[x86_64|64bit x86]].&lt;br /&gt;
 &lt;br /&gt;
I64A introduces a new [[x86 Operating Mode]] to the existing set already present in [[IA-32]] referred to as [[IA-32e]], which has two sub-modes, [[IA-32e Compatibility Mode]] and [[IA-32e 64bit Mode]].&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
I64A is the most common [[x86]] architecture in use today, and as such, we will detail things present in I64A that are also present in other [[x86]] architectures. We will describe average somewhat modern Intel CPU here.&lt;br /&gt;
&lt;br /&gt;
When the system boots up, the [[Intel Managemenet Engine]] (IME) initializes the chipset, then loads the [[Motherboard Firmware]] from its ROM, and jumps to it. The [[Motherboard Firmware]] then initializes the computer, [[Power-On Self Test|POSTs]], and executes its defined [[Firmware Interface]] to load a [[Bootloader]]. &lt;br /&gt;
&lt;br /&gt;
The two main [[Firmware Interface|Firmware Interfaces]] are [[Basic Input-Output System|BIOS]] and [[Unified Extensible Firmware Interface|UEFI]]. [[Basic Input-Output System|BIOS]] is older, back from [[Disk Operating System|DOS]] days. [[Unified Extensible Firmware Interface|UEFI]] is newer, and the current preferred standard for most non-legacy applications.&lt;br /&gt;
&lt;br /&gt;
I64A has several [[x86 Operating Mode|operating modes]].&lt;br /&gt;
* [[Protected Mode]] (native)&lt;br /&gt;
* [[Real-address Mode]] (emulated)&lt;br /&gt;
* [[System-management Mode]] (SMM)&lt;br /&gt;
* [[Compatibility Mode]] (IA-32e)&lt;br /&gt;
* [[64-bit Mode]] (IA-32e)&lt;br /&gt;
&lt;br /&gt;
===== Protected Mode =====&lt;br /&gt;
Main article: [[Protected Mode]]&lt;br /&gt;
32-bit [[General-Purpose Register|GPR]] set. Instructions default to 32bit (operand size and address size). Addresses consist of a 16-bit [[Segment Selector]] and 32-bit offset.&lt;br /&gt;
&lt;br /&gt;
Protected Mode (henceforth referred to as PM) supports both [[Paging]] and [[Segmentation]].&lt;br /&gt;
[[Segmentation]] is ''mandatory'', though it can be configured to be essentially a no-op, a so-called [[Flat Segmentation Model]], eg. if you want to use [[Paging]] only.&lt;br /&gt;
&lt;br /&gt;
Segmentation is configured though a [[Global Descriptor Table]].&lt;br /&gt;
===== Real-address Mode =====&lt;br /&gt;
Main article: [[Real-address Mode]]&lt;br /&gt;
16-bit [[General-Purpose Register|GPR]] set. Essentially just emulates an [[8086]]. Thus, 16-bit addresses with 4-bit [[Segment Registers]] for [[Segment Selector|Segment Selection]]. Do note that ''[[Segment Registers]]'' are different from but interconnected with [[Segmentation]]! [[Segment Selector|Segment Selection]] allows for the existence of several separate address spaces ''only'', it is ''not'' a form of protected memory like [[Protected Mode|PM]]'s [[Segmentation]] - you ''cannot'' configure memory protection (which [[Protected Mode]] gets its name from) controls.&lt;br /&gt;
===== System-management Mode =====&lt;br /&gt;
Main article: [[System-management Mode]]&lt;br /&gt;
It's a part of the APIs the [[Motherboard Firmware]] implementation uses for implementing certain features. Namely, the CPU switches to this mode when it receives a [[System Management Interrupt]], that is, a certain [[Hardware Interrupt]] on the [[System Management Interrupt|SMI]] line (which is kind of like the [[Non-Maskable Interrupt|NMI]] line).&lt;br /&gt;
&lt;br /&gt;
Not to be confused with the [[System Management Module]]. Thanks Intel.&lt;br /&gt;
===== Compatibility Mode =====&lt;br /&gt;
===== 64-bit Mode =====&lt;br /&gt;
In 64-bit mode, segmentation is ''mostly'' disabled. The [[Segment Register|segment registers]] still need to hold a valid [[Segment Selector]] for a valid [[Segment Entry]], but the base field is not used in address calculations.&lt;br /&gt;
Do note that there are [[GSBASE]] and [[FSBASE]] [[Model Specific Register|MSRs]] present which ''are'' used in [[Effective Address]] calculations if the instruction has a FS or GS [[Segment Override Instruction Prefix]]. Those [[Model Specific Register|MSRs]] are written to with the base of the selected segment when their respective segment registers are written to (TODO verify, manual doesn't state as such)&lt;br /&gt;
&lt;br /&gt;
[[Category:X86]]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Apic&amp;diff=113</id>
		<title>Apic</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Apic&amp;diff=113"/>
		<updated>2024-12-21T07:00:41Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: TheCatgirls moved page Apic to APIC: Uppercase :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[APIC]]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=APIC&amp;diff=112</id>
		<title>APIC</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=APIC&amp;diff=112"/>
		<updated>2024-12-21T07:00:41Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: TheCatgirls moved page Apic to APIC: Uppercase :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==LAPIC and IOAPIC==&lt;br /&gt;
&lt;br /&gt;
The Advanced Programmable Interrupter Controller(APIC) is a interrupt controller designed to replace the 8529 Intel programmable interrupt controller(PIC) that had been standard up until this point. The reason for this replacement was two fold. Multiprocessor systems where becoming more common and the old PIC was unable to control which CPU cores would be sent interrupts, Along with the APIC being capable of sending Inter-Processor-Interrupts(IPI).&lt;br /&gt;
&lt;br /&gt;
This allowed for OS's to have more fine grained control over their interrupts and allowed for better hardware delegation of interrupts allowing certain CPU cores to handle certain interrupts. The design of the APIC is simple really it's split into two pieces the Local APIC(LAPIC) and the IOAPIC. With each LAPIC and IOAPIC having an ID number on their dedicated APIC bus.&lt;br /&gt;
&lt;br /&gt;
The Local APIC is a CPU core local interrupt controller, each CPU core has it's own LAPIC, these can handle their own timer interrupts and external Hardware Interrupts that are sent via the IOAPIC. The IOAPIC on the other hand is connected to external devices([[PIT]],[[HPET]],[[PS/2]] Controller, etc...) and through the use of redirection tables it can be programmed with a LAPIC ID in each Interrupt redirection table entry. This ID controls which LAPIC and thus which core will service this hardware interrupt. It is quite common for a system to have one IOAPIC however plenty of systems may two or more IOAPICs you should parse the MP tables or the [[ACPI]] [[MADT]] table to ensure all IOAPICs are found.&lt;br /&gt;
&lt;br /&gt;
===Please Note===&lt;br /&gt;
The MP specification is an old spec and though it will contain the information needed for the IOAPIC and LAPIC. It may not be present on newer systems and the ACPI tables should be preferred over the MP spec wherever possible.&lt;br /&gt;
&lt;br /&gt;
==LAPIC==&lt;br /&gt;
Support for the local APIC can be queried using two different methods. One would be using CPUID &amp;lt;code&amp;gt;EDX=0x00000001&amp;lt;/code&amp;gt;. Or you could parse the [[MP Tables]] or the [[ACPI]] [[MADT]] table(Which you would likely want to do anyway for SMP). You could also check the APIC Base MSR and assume if those exist that the LAPIC is present at the &amp;quot;default&amp;quot; physical address of &amp;lt;code&amp;gt;0xfee00000&amp;lt;/code&amp;gt;. However the best way would be to check the CPUID, then parse the [[MP Tables|MP]] or the ACPI [[MADT]] table to determine both the if APIC is supported and get the LAPIC Physical address from the [[MP Tables|MP]]/[[MADT]] Table. If you wish to double check this base address you can also check the APIC Base MSR(`0x1b`). &lt;br /&gt;
&lt;br /&gt;
===Register Layout===&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
&lt;br /&gt;
==IOAPIC==&lt;br /&gt;
The IOAPIC can be queried in multiple different ways one is to assume that if the LAPIC exists that at least one IOAPIC exists at the &amp;quot;default&amp;quot; physical address of &amp;lt;code&amp;gt;0xfec00000&amp;lt;/code&amp;gt;. However again this isn't ideal and you should attempt to parse either the [[MP Tables]] or the [[ACPI]] [[MADT]] Tables. To Ensure you have the correct physical addresses and have found all IOAPICs in this system.&lt;br /&gt;
&lt;br /&gt;
===Register Layout===&lt;br /&gt;
todo:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Programming LAPIC/IOAPIC ==&lt;br /&gt;
When Programming these devices their memory addresses should always be marked as non-cacheable to ensure proper operation of the devices as caching them could produce strange and undesired results due to cached values being read rather than the actual true values of the MMIO registers. In the below code we are also going to assume that everything is at it's &amp;quot;default&amp;quot; standard physical address in memory and that if paging is active it's just a simple identity map paging i.e. Virtual Address = Physical Address. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In your kernel you are going to want to parse ACPI structures and map these physical addresses in a way that makes sense for your [[VMM]].&lt;br /&gt;
&lt;br /&gt;
=== IOAPIC: ===&lt;br /&gt;
Below is an example of programming the IOAPIC to route GSI 2 typically ISA IRQ 0(PIT Timer) to CPU 0 with the interrupt vector set to &amp;lt;code&amp;gt;0x20&amp;lt;/code&amp;gt; this is because the IOAPIC operates on register select and window model of programming meaning that &amp;lt;code&amp;gt;base + 0&amp;lt;/code&amp;gt; = the register to select. and &amp;lt;code&amp;gt;base + 0x10&amp;lt;/code&amp;gt; = the selected register. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each Interrupt redirection entry is split into two 32bit registers. The lower bits contains data such as which IDT vector will be called for this interrupt, polarity, delivery mode, edge or level triggered, masked, etc... &lt;br /&gt;
&lt;br /&gt;
While the upper 32bits contain the the LAPIC ID that this interrupt will be sent to. Depending on the setting of bit 11 of the lower 32bit. See &amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
void ioapic_init() {&lt;br /&gt;
    volatile uint32_t *ioapic = (uint32_t*)0xfec00000;&lt;br /&gt;
    /*Timer Interrupt for QEMU*/&lt;br /&gt;
    base[0] = 0x14; /*GSI Interrupt 2 Most commonly PIT/HPET timer*/&lt;br /&gt;
    base[4] = 0x20; /*Interrupt Vector i.e. IDT vector 0x20 will be called for this*/&lt;br /&gt;
    base[0] = 0x14; /*GSI Interrupt 2 upper 32bit*/&lt;br /&gt;
    base[4] = 0x00; &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
[https://pdos.csail.mit.edu/6.828/2016/readings/ia32/ioapic.pdf IOAPIC datasheet from MIT.edu]&lt;br /&gt;
&lt;br /&gt;
[https://uefi.org/sites/default/files/resources/ACPI%20Spec%206%205%20Aug29.pdf ACPI Spec]&lt;br /&gt;
&lt;br /&gt;
[https://pdos.csail.mit.edu/6.828/2018/readings/ia32/MPspec.pdf MPspec Datasheet from MIT.edu]&lt;br /&gt;
&lt;br /&gt;
[https://cdrdv2.intel.com/v1/dl/getContent/671200 Intel SDM Full(Volume 3 chapter 12 for APIC Documentation)]&lt;br /&gt;
&lt;br /&gt;
[https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/40332.pdf AMD SDM(Volume 2 chapter 16 for APIC Documentation)]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=110</id>
		<title>Intel 64 Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=110"/>
		<updated>2024-12-19T15:16:40Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Fix link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Architecture =&lt;br /&gt;
&lt;br /&gt;
The Intel 64 Architecture is a 64-bit extension of the 32-bit [[x86]] [[IA-32]] architecture. It was introduced around 2004, reimplementing [[AMD64]], AMD's 64-bit extension.&lt;br /&gt;
&lt;br /&gt;
Both [[AMD64]] and Intel 64 Architecture (from henceforth referred to as I64A; Do not confuse with [[Itanium]], referred to as [[Itanium|IA64]].) are collectively referred to as [[x86_64]], and commonly as [[x86_64|x64]], or [[x86_64|64bit x86]].&lt;br /&gt;
 &lt;br /&gt;
I64A introduces a new [[x86 Operating Mode]] to the existing set already present in [[IA-32]] referred to as [[IA-32e]], which has two sub-modes, [[IA-32e Compatibility Mode]] and [[IA-32e 64bit Mode]].&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
I64A is the most common [[x86]] architecture in use today, and as such, we will detail things present in I64A that are also present in other [[x86]] architectures. We will describe average somewhat modern Intel CPU here.&lt;br /&gt;
&lt;br /&gt;
When the system boots up, the [[Intel Managemenet Engine]] (IME) initializes the chipset, then loads the [[Motherboard Firmware]] from its ROM, and jumps to it. The [[Motherboard Firmware]] then initializes the computer, [[Power-On Self Test|POSTs]], and executes its defined [[Firmware Interface]] to load a [[Bootloader]]. &lt;br /&gt;
&lt;br /&gt;
The two main [[Firmware Interface|Firmware Interfaces]] are [[Basic Input-Output System|BIOS]] and [[Unified Extensible Firmware Interface|UEFI]]. [[Basic Input-Output System|BIOS]] is older, back from [[Disk Operating System|DOS]] days. [[Unified Extensible Firmware Interface|UEFI]] is newer, and the current preferred standard for most non-legacy applications.&lt;br /&gt;
&lt;br /&gt;
I64A has several [[x86 Operating Mode|operating modes]].&lt;br /&gt;
* [[Protected Mode]] (native)&lt;br /&gt;
* [[Real-address Mode]] (emulated)&lt;br /&gt;
* [[System-management Mode]] (SMM)&lt;br /&gt;
* [[Compatibility Mode]] (IA-32e)&lt;br /&gt;
* [[64-bit Mode]] (IA-32e)&lt;br /&gt;
&lt;br /&gt;
===== Protected Mode =====&lt;br /&gt;
Main article: [[Protected Mode]]&lt;br /&gt;
32-bit [[General-Purpose Register|GPR]] set. Instructions default to 32bit (operand size and address size). Addresses consist of a 16-bit [[Segment Selector]] and 32-bit offset.&lt;br /&gt;
&lt;br /&gt;
Protected Mode (henceforth referred to as PM) supports both [[Paging]] and [[Segmentation]].&lt;br /&gt;
[[Segmentation]] is ''mandatory'', though it can be configured to be essentially a no-op, a so-called [[Flat Segmentation Model]], eg. if you want to use [[Paging]] only.&lt;br /&gt;
&lt;br /&gt;
Segmentation is configured though a [[Global Descriptor Table]].&lt;br /&gt;
===== Real-address Mode =====&lt;br /&gt;
Main article: [[Real-address Mode]]&lt;br /&gt;
16-bit [[General-Purpose Register|GPR]] set. Essentially just emulates an [[8086]]. Thus, 16-bit addresses with 4-bit [[Segment Registers]] for [[Segment Selector|Segment Selection]]. Do note that ''[[Segment Registers]]'' are different from but interconnected with [[Segmentation]]! [[Segment Selector|Segment Selection]] allows for the existence of several separate address spaces ''only'', it is ''not'' a form of protected memory like [[Protected Mode|PM]]'s [[Segmentation]] - you ''cannot'' configure memory protection (which [[Protected Mode]] gets its name from) controls.&lt;br /&gt;
===== System-management Mode =====&lt;br /&gt;
Main article: [[System-management Mode]]&lt;br /&gt;
It's a part of the APIs the [[Motherboard Firmware]] implementation uses for implementing certain features. Namely, the CPU switches to this mode when it receives a [[System Management Interrupt]], that is, a certain [[Hardware Interrupt]] on the [[System Management Interrupt|SMI]] line (which is kind of like the [[Non-Maskable Interrupt|NMI]] line).&lt;br /&gt;
&lt;br /&gt;
Not to be confused with the [[System Management Module]]. Thanks Intel.&lt;br /&gt;
===== Compatibility Mode =====&lt;br /&gt;
===== 64-bit Mode =====&lt;br /&gt;
In 64-bit mode, segmentation is ''mostly'' disabled. The [[Segment Register|segment registers]] still need to hold a valid [[Segment Selector]] for a valid [[Segment Entry]], but the base field is not used in address calculations.&lt;br /&gt;
Do note that there are [[GSBASE]] and [[FSBASE]] [[Model Specific Register|MSRs]] present which _are_ used in [[Effective Address]] calculations if the instruction has a FS or GS [[Segment Override Instruction Prefix]]. Those [[Model Specific Register|MSRs]] are written to with the base of the selected segment when their respective segment registers are written to (TODO verify, manual doesn't state as such)&lt;br /&gt;
&lt;br /&gt;
[[Category:X86]]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=109</id>
		<title>Intel 64 Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=109"/>
		<updated>2024-12-19T15:16:09Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: 64-bit Mode expanded&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Architecture =&lt;br /&gt;
&lt;br /&gt;
The Intel 64 Architecture is a 64-bit extension of the 32-bit [[x86]] [[IA-32]] architecture. It was introduced around 2004, reimplementing [[AMD64]], AMD's 64-bit extension.&lt;br /&gt;
&lt;br /&gt;
Both [[AMD64]] and Intel 64 Architecture (from henceforth referred to as I64A; Do not confuse with [[Itanium]], referred to as [[Itanium|IA64]].) are collectively referred to as [[x86_64]], and commonly as [[x86_64|x64]], or [[x86_64|64bit x86]].&lt;br /&gt;
 &lt;br /&gt;
I64A introduces a new [[x86 Operating Mode]] to the existing set already present in [[IA32]] referred to as [[IA-32e]], which has two sub-modes, [[IA-32e Compatibility Mode]] and [[IA-32e 64bit Mode]].&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
I64A is the most common [[x86]] architecture in use today, and as such, we will detail things present in I64A that are also present in other [[x86]] architectures. We will describe average somewhat modern Intel CPU here.&lt;br /&gt;
&lt;br /&gt;
When the system boots up, the [[Intel Managemenet Engine]] (IME) initializes the chipset, then loads the [[Motherboard Firmware]] from its ROM, and jumps to it. The [[Motherboard Firmware]] then initializes the computer, [[Power-On Self Test|POSTs]], and executes its defined [[Firmware Interface]] to load a [[Bootloader]]. &lt;br /&gt;
&lt;br /&gt;
The two main [[Firmware Interface|Firmware Interfaces]] are [[Basic Input-Output System|BIOS]] and [[Unified Extensible Firmware Interface|UEFI]]. [[Basic Input-Output System|BIOS]] is older, back from [[Disk Operating System|DOS]] days. [[Unified Extensible Firmware Interface|UEFI]] is newer, and the current preferred standard for most non-legacy applications.&lt;br /&gt;
&lt;br /&gt;
I64A has several [[x86 Operating Mode|operating modes]].&lt;br /&gt;
* [[Protected Mode]] (native)&lt;br /&gt;
* [[Real-address Mode]] (emulated)&lt;br /&gt;
* [[System-management Mode]] (SMM)&lt;br /&gt;
* [[Compatibility Mode]] (IA-32e)&lt;br /&gt;
* [[64-bit Mode]] (IA-32e)&lt;br /&gt;
&lt;br /&gt;
===== Protected Mode =====&lt;br /&gt;
Main article: [[Protected Mode]]&lt;br /&gt;
32-bit [[General-Purpose Register|GPR]] set. Instructions default to 32bit (operand size and address size). Addresses consist of a 16-bit [[Segment Selector]] and 32-bit offset.&lt;br /&gt;
&lt;br /&gt;
Protected Mode (henceforth referred to as PM) supports both [[Paging]] and [[Segmentation]].&lt;br /&gt;
[[Segmentation]] is ''mandatory'', though it can be configured to be essentially a no-op, a so-called [[Flat Segmentation Model]], eg. if you want to use [[Paging]] only.&lt;br /&gt;
&lt;br /&gt;
Segmentation is configured though a [[Global Descriptor Table]].&lt;br /&gt;
===== Real-address Mode =====&lt;br /&gt;
Main article: [[Real-address Mode]]&lt;br /&gt;
16-bit [[General-Purpose Register|GPR]] set. Essentially just emulates an [[8086]]. Thus, 16-bit addresses with 4-bit [[Segment Registers]] for [[Segment Selector|Segment Selection]]. Do note that ''[[Segment Registers]]'' are different from but interconnected with [[Segmentation]]! [[Segment Selector|Segment Selection]] allows for the existence of several separate address spaces ''only'', it is ''not'' a form of protected memory like [[Protected Mode|PM]]'s [[Segmentation]] - you ''cannot'' configure memory protection (which [[Protected Mode]] gets its name from) controls.&lt;br /&gt;
===== System-management Mode =====&lt;br /&gt;
Main article: [[System-management Mode]]&lt;br /&gt;
It's a part of the APIs the [[Motherboard Firmware]] implementation uses for implementing certain features. Namely, the CPU switches to this mode when it receives a [[System Management Interrupt]], that is, a certain [[Hardware Interrupt]] on the [[System Management Interrupt|SMI]] line (which is kind of like the [[Non-Maskable Interrupt|NMI]] line).&lt;br /&gt;
&lt;br /&gt;
Not to be confused with the [[System Management Module]]. Thanks Intel.&lt;br /&gt;
===== Compatibility Mode =====&lt;br /&gt;
===== 64-bit Mode =====&lt;br /&gt;
In 64-bit mode, segmentation is ''mostly'' disabled. The [[Segment Register|segment registers]] still need to hold a valid [[Segment Selector]] for a valid [[Segment Entry]], but the base field is not used in address calculations.&lt;br /&gt;
Do note that there are [[GSBASE]] and [[FSBASE]] [[Model Specific Register|MSRs]] present which _are_ used in [[Effective Address]] calculations if the instruction has a FS or GS [[Segment Override Instruction Prefix]]. Those [[Model Specific Register|MSRs]] are written to with the base of the selected segment when their respective segment registers are written to (TODO verify, manual doesn't state as such)&lt;br /&gt;
&lt;br /&gt;
[[Category:X86]]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=IA32_Manual_Conventions&amp;diff=108</id>
		<title>IA32 Manual Conventions</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=IA32_Manual_Conventions&amp;diff=108"/>
		<updated>2024-12-19T15:09:27Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Add to x86 category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bit number 0 is the first, [[Least Significant Bit]].&lt;br /&gt;
Bit ranges are written inclusive. Example with [[Segment Selector|Segment Selectors]]:&lt;br /&gt;
&lt;br /&gt;
[[File:Segment_Selectors_Screenshot_01.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Bit 0 is the least significant bit, bit 15 is the [[Most Significant Bit]]. Range &amp;quot;bits 3 through 15&amp;quot; ''include'' bit 3 and bit 15 and are 13 bits long, with bit 0 through 1 aka bit 0 and 1 being the [[Requested Priviledge Level|RPL]] and bit 2 (3rd bit) being the [[Table Indicator|TI]].&lt;br /&gt;
Additionally, in memory, this is stored [[Little Endian]], so the least significant half of the index + 3 bits for the flags is in the first byte and the most significant half of the index is in the second byte. &lt;br /&gt;
Do note that eg. [[NASM]] treats &amp;lt;code&amp;gt;0b&amp;lt;/code&amp;gt; as numeric literals, so it'll swap the bytes around - Thus, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mov ax, 0000_0000_0000_1000b&lt;br /&gt;
mov cs, ax&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Puts [[Segment Selector]] with [[Requested Priviledge Level|RPL]]=0 into the ''second'' (2, 0b10, 0x2) entry of the ''[[Global Descriptor Table|GDT]]'', with the 1 being the 4th bit aka bit 3 into the [[Code Segment Register|CS register]].&lt;br /&gt;
[[Category:X86]]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=107</id>
		<title>Intel 64 Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=107"/>
		<updated>2024-12-19T15:08:32Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Architecture =&lt;br /&gt;
&lt;br /&gt;
The Intel 64 Architecture is a 64-bit extension of the 32-bit [[x86]] [[IA-32]] architecture. It was introduced around 2004, reimplementing [[AMD64]], AMD's 64-bit extension.&lt;br /&gt;
&lt;br /&gt;
Both [[AMD64]] and Intel 64 Architecture (from henceforth referred to as I64A; Do not confuse with [[Itanium]], referred to as [[Itanium|IA64]].) are collectively referred to as [[x86_64]], and commonly as [[x86_64|x64]], or [[x86_64|64bit x86]].&lt;br /&gt;
 &lt;br /&gt;
I64A introduces a new [[x86 Operating Mode]] to the existing set already present in [[IA32]] referred to as [[IA-32e]], which has two sub-modes, [[IA-32e Compatibility Mode]] and [[IA-32e 64bit Mode]].&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
I64A is the most common [[x86]] architecture in use today, and as such, we will detail things present in I64A that are also present in other [[x86]] architectures. We will describe average somewhat modern Intel CPU here.&lt;br /&gt;
&lt;br /&gt;
When the system boots up, the [[Intel Managemenet Engine]] (IME) initializes the chipset, then loads the [[Motherboard Firmware]] from its ROM, and jumps to it. The [[Motherboard Firmware]] then initializes the computer, [[Power-On Self Test|POSTs]], and executes its defined [[Firmware Interface]] to load a [[Bootloader]]. &lt;br /&gt;
&lt;br /&gt;
The two main [[Firmware Interface|Firmware Interfaces]] are [[Basic Input-Output System|BIOS]] and [[Unified Extensible Firmware Interface|UEFI]]. [[Basic Input-Output System|BIOS]] is older, back from [[Disk Operating System|DOS]] days. [[Unified Extensible Firmware Interface|UEFI]] is newer, and the current preferred standard for most non-legacy applications.&lt;br /&gt;
&lt;br /&gt;
I64A has several [[x86 Operating Mode|operating modes]].&lt;br /&gt;
* [[Protected Mode]] (native)&lt;br /&gt;
* [[Real-address Mode]] (emulated)&lt;br /&gt;
* [[System-management Mode]] (SMM)&lt;br /&gt;
* [[Compatibility Mode]] (IA-32e)&lt;br /&gt;
* [[64-bit Mode]] (IA-32e)&lt;br /&gt;
&lt;br /&gt;
===== Protected Mode =====&lt;br /&gt;
Main article: [[Protected Mode]]&lt;br /&gt;
32-bit [[General-Purpose Register|GPR]] set. Instructions default to 32bit (operand size and address size). Addresses consist of a 16-bit [[Segment Selector]] and 32-bit offset.&lt;br /&gt;
&lt;br /&gt;
Protected Mode (henceforth referred to as PM) supports both [[Paging]] and [[Segmentation]].&lt;br /&gt;
[[Segmentation]] is ''mandatory'', though it can be configured to be essentially a no-op, a so-called [[Flat Segmentation Model]], eg. if you want to use [[Paging]] only.&lt;br /&gt;
&lt;br /&gt;
Segmentation is configured though a [[Global Descriptor Table]].&lt;br /&gt;
===== Real-address Mode =====&lt;br /&gt;
Main article: [[Real-address Mode]]&lt;br /&gt;
16-bit [[General-Purpose Register|GPR]] set. Essentially just emulates an [[8086]]. Thus, 16-bit addresses with 4-bit [[Segment Registers]] for [[Segment Selector|Segment Selection]]. Do note that ''[[Segment Registers]]'' are different from but interconnected with [[Segmentation]]! [[Segment Selector|Segment Selection]] allows for the existence of several separate address spaces ''only'', it is ''not'' a form of protected memory like [[Protected Mode|PM]]'s [[Segmentation]] - you ''cannot'' configure memory protection (which [[Protected Mode]] gets its name from) controls.&lt;br /&gt;
===== System-management Mode =====&lt;br /&gt;
Main article: [[System-management Mode]]&lt;br /&gt;
It's a part of the APIs the [[Motherboard Firmware]] implementation uses for implementing certain features. Namely, the CPU switches to this mode when it receives a [[System Management Interrupt]], that is, a certain [[Hardware Interrupt]] on the [[System Management Interrupt|SMI]] line (which is kind of like the [[Non-Maskable Interrupt|NMI]] line).&lt;br /&gt;
&lt;br /&gt;
Not to be confused with the [[System Management Module]]. Thanks Intel.&lt;br /&gt;
===== Compatibility Mode =====&lt;br /&gt;
===== 64-bit Mode =====&lt;br /&gt;
&lt;br /&gt;
[[Category:X86]]&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=106</id>
		<title>VirtIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=106"/>
		<updated>2024-12-19T01:39:26Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Actually, 1.3 is latest, not 1.2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VirtIO is a standard for performant virtualized hardware for use within virtual machines, created and managed by the [https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio OASIS Open Virtual I/O Device TC]. VirtIO supports a variety of devices, such as, but not limited to: block (e.g. hard drive), network card, GPU, etc. Each of these devices have their own specific configuration and features, but all use the same underlying VirtIO queue structure for relaying data and commands to &amp;amp; from the device.&lt;br /&gt;
&lt;br /&gt;
The latest specification, 1.3, is available at https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html.&lt;br /&gt;
&lt;br /&gt;
VirtIO provides a common framework for devices to be identified and for communicating between the device implementation and the driver.&lt;br /&gt;
Communication for is handled through so-called ''virtqueues''.&lt;br /&gt;
&lt;br /&gt;
Certain implementations extend the features available.&lt;br /&gt;
&lt;br /&gt;
For example, here is the list of virtio-gpu capsets in Mesa, at &amp;lt;code&amp;gt;src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.h&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define VIRTGPU_CAPSET_VIRGL 1&lt;br /&gt;
#define VIRTGPU_CAPSET_VIRGL2 2&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_VULKAN 3&lt;br /&gt;
#define VIRTGPU_CAPSET_VENUS 4&lt;br /&gt;
#define VIRTGPU_CAPSET_CROSS_DOMAIN 5&lt;br /&gt;
#define VIRTGPU_CAPSET_DRM 6&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_MAGMA 7&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_GLES 8&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_COMPOSER 9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
virtio-gpu can be used to forward various things to Linux hosts, such as native Wayland surfaces, or Linux drm ioctls. Commonly this is used with Linux guests, but there's nothing preventing usage in any other OS running as guest.&lt;br /&gt;
&lt;br /&gt;
=== Device Types ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable mw-collapsible&amp;quot;&lt;br /&gt;
|+VirtIO Device Types&lt;br /&gt;
!Device ID&lt;br /&gt;
!Device Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|reserved (invalid)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|network card&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|block device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|console&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|entropy source&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|memory ballooning (traditional)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|ioMemory&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|rpmsg&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|SCSI host&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|9P transport&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|mac80211 wlan&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|rproc serial&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|virtio CAIF&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|memory balloon&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GPU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Timer/Clock device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|Input device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|Socket device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|20&lt;br /&gt;
|Crypto device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|21&lt;br /&gt;
|Signal Distribution Module&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|22&lt;br /&gt;
|pstore device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|23&lt;br /&gt;
|IOMMU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|24&lt;br /&gt;
|Memory device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|25&lt;br /&gt;
|Audio device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|26&lt;br /&gt;
|file system device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|27&lt;br /&gt;
|PMEM device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|28&lt;br /&gt;
|RPMB device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|29&lt;br /&gt;
|mac80211 hwsim wireless simulation device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|30&lt;br /&gt;
|Video encoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|31&lt;br /&gt;
|Video decoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|32&lt;br /&gt;
|SCMI device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|33&lt;br /&gt;
|NitroSecureModule&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|34&lt;br /&gt;
|I2C adapter&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|35&lt;br /&gt;
|Watchdog&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|36&lt;br /&gt;
|CAN device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|38&lt;br /&gt;
|Parameter Server&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|39&lt;br /&gt;
|Audio policy device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|40&lt;br /&gt;
|Bluetooth device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|41&lt;br /&gt;
|GPIO device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|42&lt;br /&gt;
|RDMA device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Device Transports ===&lt;br /&gt;
VirtIO supports three different types of device transports: [[PCI|PCI Bus]], [[MMIO]], and [[Channel I/O]]. The PCIe transport is configured via the normal PCIe configuration mechanisms, while the MMIO transport is configured strictly via MMIO reads and writes.&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=105</id>
		<title>VirtIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=105"/>
		<updated>2024-12-19T01:37:44Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: s/driver/drm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VirtIO is a standard for performant virtualized hardware for use within virtual machines, created and managed by the [https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio OASIS Open Virtual I/O Device TC]. VirtIO supports a variety of devices, such as, but not limited to: block (e.g. hard drive), network card, GPU, etc. Each of these devices have their own specific configuration and features, but all use the same underlying VirtIO queue structure for relaying data and commands to &amp;amp; from the device.&lt;br /&gt;
&lt;br /&gt;
The latest specification, 1.2, is available at https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html.&lt;br /&gt;
&lt;br /&gt;
VirtIO provides a common framework for devices to be identified and for communicating between the device implementation and the driver.&lt;br /&gt;
Communication for is handled through so-called ''virtqueues''.&lt;br /&gt;
&lt;br /&gt;
Certain implementations extend the features available.&lt;br /&gt;
&lt;br /&gt;
For example, here is the list of virtio-gpu capsets in Mesa, at &amp;lt;code&amp;gt;src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.h&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define VIRTGPU_CAPSET_VIRGL 1&lt;br /&gt;
#define VIRTGPU_CAPSET_VIRGL2 2&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_VULKAN 3&lt;br /&gt;
#define VIRTGPU_CAPSET_VENUS 4&lt;br /&gt;
#define VIRTGPU_CAPSET_CROSS_DOMAIN 5&lt;br /&gt;
#define VIRTGPU_CAPSET_DRM 6&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_MAGMA 7&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_GLES 8&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_COMPOSER 9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
virtio-gpu can be used to forward various things to Linux hosts, such as native Wayland surfaces, or Linux drm ioctls. Commonly this is used with Linux guests, but there's nothing preventing usage in any other OS running as guest.&lt;br /&gt;
&lt;br /&gt;
=== Device Types ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable mw-collapsible&amp;quot;&lt;br /&gt;
|+VirtIO Device Types&lt;br /&gt;
!Device ID&lt;br /&gt;
!Device Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|reserved (invalid)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|network card&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|block device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|console&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|entropy source&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|memory ballooning (traditional)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|ioMemory&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|rpmsg&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|SCSI host&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|9P transport&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|mac80211 wlan&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|rproc serial&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|virtio CAIF&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|memory balloon&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GPU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Timer/Clock device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|Input device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|Socket device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|20&lt;br /&gt;
|Crypto device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|21&lt;br /&gt;
|Signal Distribution Module&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|22&lt;br /&gt;
|pstore device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|23&lt;br /&gt;
|IOMMU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|24&lt;br /&gt;
|Memory device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|25&lt;br /&gt;
|Audio device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|26&lt;br /&gt;
|file system device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|27&lt;br /&gt;
|PMEM device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|28&lt;br /&gt;
|RPMB device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|29&lt;br /&gt;
|mac80211 hwsim wireless simulation device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|30&lt;br /&gt;
|Video encoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|31&lt;br /&gt;
|Video decoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|32&lt;br /&gt;
|SCMI device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|33&lt;br /&gt;
|NitroSecureModule&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|34&lt;br /&gt;
|I2C adapter&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|35&lt;br /&gt;
|Watchdog&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|36&lt;br /&gt;
|CAN device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|38&lt;br /&gt;
|Parameter Server&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|39&lt;br /&gt;
|Audio policy device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|40&lt;br /&gt;
|Bluetooth device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|41&lt;br /&gt;
|GPIO device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|42&lt;br /&gt;
|RDMA device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Device Transports ===&lt;br /&gt;
VirtIO supports three different types of device transports: [[PCI|PCI Bus]], [[MMIO]], and [[Channel I/O]]. The PCIe transport is configured via the normal PCIe configuration mechanisms, while the MMIO transport is configured strictly via MMIO reads and writes.&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=104</id>
		<title>VirtIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=104"/>
		<updated>2024-12-19T01:37:05Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Link to the virtio spec + list the modern virtio-gpu capsets&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VirtIO is a standard for performant virtualized hardware for use within virtual machines, created and managed by the [https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio OASIS Open Virtual I/O Device TC]. VirtIO supports a variety of devices, such as, but not limited to: block (e.g. hard drive), network card, GPU, etc. Each of these devices have their own specific configuration and features, but all use the same underlying VirtIO queue structure for relaying data and commands to &amp;amp; from the device.&lt;br /&gt;
&lt;br /&gt;
The latest specification, 1.2, is available at https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html.&lt;br /&gt;
&lt;br /&gt;
VirtIO provides a common framework for devices to be identified and for communicating between the device implementation and the driver.&lt;br /&gt;
Communication for is handled through so-called ''virtqueues''.&lt;br /&gt;
&lt;br /&gt;
Certain implementations extend the features available.&lt;br /&gt;
&lt;br /&gt;
For example, here is the list of virtio-gpu capsets in Mesa, at &amp;lt;code&amp;gt;src/gfxstream/guest/platform/include/virtgpu_gfxstream_protocol.h&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define VIRTGPU_CAPSET_VIRGL 1&lt;br /&gt;
#define VIRTGPU_CAPSET_VIRGL2 2&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_VULKAN 3&lt;br /&gt;
#define VIRTGPU_CAPSET_VENUS 4&lt;br /&gt;
#define VIRTGPU_CAPSET_CROSS_DOMAIN 5&lt;br /&gt;
#define VIRTGPU_CAPSET_DRM 6&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_MAGMA 7&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_GLES 8&lt;br /&gt;
#define VIRTGPU_CAPSET_GFXSTREAM_COMPOSER 9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
virtio-gpu can be used to forward various things to Linux hosts, such as native Wayland surfaces, or Linux driver ioctls. Commonly this is used with Linux guests, but there's nothing preventing usage in any other OS running as guest.&lt;br /&gt;
&lt;br /&gt;
=== Device Types ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable mw-collapsible&amp;quot;&lt;br /&gt;
|+VirtIO Device Types&lt;br /&gt;
!Device ID&lt;br /&gt;
!Device Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|reserved (invalid)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|network card&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|block device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|console&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|entropy source&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|memory ballooning (traditional)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|ioMemory&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|rpmsg&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|SCSI host&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|9P transport&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|mac80211 wlan&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|rproc serial&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|virtio CAIF&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|memory balloon&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GPU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Timer/Clock device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|Input device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|Socket device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|20&lt;br /&gt;
|Crypto device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|21&lt;br /&gt;
|Signal Distribution Module&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|22&lt;br /&gt;
|pstore device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|23&lt;br /&gt;
|IOMMU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|24&lt;br /&gt;
|Memory device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|25&lt;br /&gt;
|Audio device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|26&lt;br /&gt;
|file system device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|27&lt;br /&gt;
|PMEM device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|28&lt;br /&gt;
|RPMB device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|29&lt;br /&gt;
|mac80211 hwsim wireless simulation device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|30&lt;br /&gt;
|Video encoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|31&lt;br /&gt;
|Video decoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|32&lt;br /&gt;
|SCMI device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|33&lt;br /&gt;
|NitroSecureModule&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|34&lt;br /&gt;
|I2C adapter&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|35&lt;br /&gt;
|Watchdog&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|36&lt;br /&gt;
|CAN device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|38&lt;br /&gt;
|Parameter Server&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|39&lt;br /&gt;
|Audio policy device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|40&lt;br /&gt;
|Bluetooth device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|41&lt;br /&gt;
|GPIO device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|42&lt;br /&gt;
|RDMA device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Device Transports ===&lt;br /&gt;
VirtIO supports three different types of device transports: [[PCI|PCI Bus]], [[MMIO]], and [[Channel I/O]]. The PCIe transport is configured via the normal PCIe configuration mechanisms, while the MMIO transport is configured strictly via MMIO reads and writes.&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=103</id>
		<title>VirtIO</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=VirtIO&amp;diff=103"/>
		<updated>2024-12-19T01:21:09Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: List all device types, TODO fill a description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;VirtIO is a standard for performant virtualized hardware for use within virtual machines, created and managed by the [https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=virtio OASIS Open Virtual I/O Device TC]. VirtIO supports a variety of devices, such as, but not limited to: block (e.g. hard drive), network card, GPU, etc. Each of these devices have their own specific configuration and features, but all use the same underlying VirtIO queue structure for relaying data and commands to &amp;amp; from the device.&lt;br /&gt;
&lt;br /&gt;
=== Device Types ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable mw-collapsible&amp;quot;&lt;br /&gt;
|+VirtIO Device Types&lt;br /&gt;
!Device ID&lt;br /&gt;
!Device Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|reserved (invalid)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|network card&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|block device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|console&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|entropy source&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|memory ballooning (traditional)&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|ioMemory&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|7&lt;br /&gt;
|rpmsg&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|8&lt;br /&gt;
|SCSI host&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|9&lt;br /&gt;
|9P transport&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|mac80211 wlan&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|11&lt;br /&gt;
|rproc serial&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|12&lt;br /&gt;
|virtio CAIF&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|13&lt;br /&gt;
|memory balloon&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|16&lt;br /&gt;
|GPU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|17&lt;br /&gt;
|Timer/Clock device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|18&lt;br /&gt;
|Input device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|19&lt;br /&gt;
|Socket device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|20&lt;br /&gt;
|Crypto device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|21&lt;br /&gt;
|Signal Distribution Module&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|22&lt;br /&gt;
|pstore device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|23&lt;br /&gt;
|IOMMU device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|24&lt;br /&gt;
|Memory device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|25&lt;br /&gt;
|Audio device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|26&lt;br /&gt;
|file system device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|27&lt;br /&gt;
|PMEM device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|28&lt;br /&gt;
|RPMB device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|29&lt;br /&gt;
|mac80211 hwsim wireless simulation device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|30&lt;br /&gt;
|Video encoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|31&lt;br /&gt;
|Video decoder device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|32&lt;br /&gt;
|SCMI device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|33&lt;br /&gt;
|NitroSecureModule&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|34&lt;br /&gt;
|I2C adapter&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|35&lt;br /&gt;
|Watchdog&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|36&lt;br /&gt;
|CAN device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|38&lt;br /&gt;
|Parameter Server&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|39&lt;br /&gt;
|Audio policy device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|40&lt;br /&gt;
|Bluetooth device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|41&lt;br /&gt;
|GPIO device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
|42&lt;br /&gt;
|RDMA device&lt;br /&gt;
| TODO&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Device Transports ===&lt;br /&gt;
VirtIO supports three different types of device transports: [[PCI|PCI Bus]], [[MMIO]], and [[Channel I/O]]. The PCIe transport is configured via the normal PCIe configuration mechanisms, while the MMIO transport is configured strictly via MMIO reads and writes.&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=IA32_Manual_Conventions&amp;diff=102</id>
		<title>IA32 Manual Conventions</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=IA32_Manual_Conventions&amp;diff=102"/>
		<updated>2024-12-19T00:49:30Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Initial description of some IA32 manual conventions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bit number 0 is the first, [[Least Significant Bit]].&lt;br /&gt;
Bit ranges are written inclusive. Example with [[Segment Selector|Segment Selectors]]:&lt;br /&gt;
&lt;br /&gt;
[[File:Segment_Selectors_Screenshot_01.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Bit 0 is the least significant bit, bit 15 is the [[Most Significant Bit]]. Range &amp;quot;bits 3 through 15&amp;quot; ''include'' bit 3 and bit 15 and are 13 bits long, with bit 0 through 1 aka bit 0 and 1 being the [[Requested Priviledge Level|RPL]] and bit 2 (3rd bit) being the [[Table Indicator|TI]].&lt;br /&gt;
Additionally, in memory, this is stored [[Little Endian]], so the least significant half of the index + 3 bits for the flags is in the first byte and the most significant half of the index is in the second byte. &lt;br /&gt;
Do note that eg. [[NASM]] treats &amp;lt;code&amp;gt;0b&amp;lt;/code&amp;gt; as numeric literals, so it'll swap the bytes around - Thus, &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mov ax, 0000_0000_0000_1000b&lt;br /&gt;
mov cs, ax&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Puts [[Segment Selector]] with [[Requested Priviledge Level|RPL]]=0 into the ''second'' (2, 0b10, 0x2) entry of the ''[[Global Descriptor Table|GDT]]'', with the 1 being the 4th bit aka bit 3 into the [[Code Segment Register|CS register]].&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=File:Segment_Selectors_Screenshot_01.png&amp;diff=101</id>
		<title>File:Segment Selectors Screenshot 01.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=File:Segment_Selectors_Screenshot_01.png&amp;diff=101"/>
		<updated>2024-12-19T00:45:47Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Screenshot of section 3.4.2 + Figure 3-6 of Volume 3A of the Intel IA32 Software Manual.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Screenshot of section 3.4.2 + Figure 3-6 of Volume 3A of the Intel IA32 Software Manual.&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=99</id>
		<title>Intel 64 Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=99"/>
		<updated>2024-12-18T17:16:04Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: IA-32e is an operating mode, not an address mode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Architecture =&lt;br /&gt;
&lt;br /&gt;
The Intel 64 Architecture is a 64-bit extension of the 32-bit [[x86]] [[IA-32]] architecture. It was introduced around 2004, reimplementing [[AMD64]], AMD's 64-bit extension.&lt;br /&gt;
&lt;br /&gt;
Both [[AMD64]] and Intel 64 Architecture (from henceforth referred to as I64A; Do not confuse with [[Itanium]], referred to as [[Itanium|IA64]].) are collectively referred to as [[x86_64]], and commonly as [[x86_64|x64]], or [[x86_64|64bit x86]].&lt;br /&gt;
 &lt;br /&gt;
I64A introduces a new [[x86 Operating Mode]] to the existing set already present in [[IA32]] referred to as [[IA-32e]], which has two sub-modes, [[IA-32e Compatibility Mode]] and [[IA-32e 64bit Mode]].&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
I64A is the most common [[x86]] architecture in use today, and as such, we will detail things present in I64A that are also present in other [[x86]] architectures. We will describe average somewhat modern Intel CPU here.&lt;br /&gt;
&lt;br /&gt;
When the system boots up, the [[Intel Managemenet Engine]] (IME) initializes the chipset, then loads the [[Motherboard Firmware]] from its ROM, and jumps to it. The [[Motherboard Firmware]] then initializes the computer, [[Power-On Self Test|POSTs]], and executes its defined [[Firmware Interface]] to load a [[Bootloader]]. &lt;br /&gt;
&lt;br /&gt;
The two main [[Firmware Interface|Firmware Interfaces]] are [[Basic Input-Output System|BIOS]] and [[Unified Extensible Firmware Interface|UEFI]]. [[Basic Input-Output System|BIOS]] is older, back from [[Disk Operating System|DOS]] days. [[Unified Extensible Firmware Interface|UEFI]] is newer, and the current preferred standard for most non-legacy applications.&lt;br /&gt;
&lt;br /&gt;
I64A has several [[x86 Operating Mode|operating modes]].&lt;br /&gt;
* [[Protected Mode]] (native)&lt;br /&gt;
* [[Real-address Mode]] (emulated)&lt;br /&gt;
* [[System-management Mode]] (SMM)&lt;br /&gt;
* [[Compatibility Mode]] (IA-32e)&lt;br /&gt;
* [[64-bit Mode]] (IA-32e)&lt;br /&gt;
&lt;br /&gt;
===== Protected Mode =====&lt;br /&gt;
Main article: [[Protected Mode]]&lt;br /&gt;
32-bit [[General-Purpose Register|GPR]] set. Instructions default to 32bit (operand size and address size). Addresses consist of a 16-bit [[Segment Selector]] and 32-bit offset.&lt;br /&gt;
&lt;br /&gt;
Protected Mode (henceforth referred to as PM) supports both [[Paging]] and [[Segmentation]].&lt;br /&gt;
[[Segmentation]] is ''mandatory'', though it can be configured to be essentially a no-op, a so-called [[Flat Segmentation Model]], eg. if you want to use [[Paging]] only.&lt;br /&gt;
&lt;br /&gt;
Segmentation is configured though a [[Global Descriptor Table]].&lt;br /&gt;
===== Real-address Mode =====&lt;br /&gt;
Main article: [[Real-address Mode]]&lt;br /&gt;
16-bit [[General-Purpose Register|GPR]] set. Essentially just emulates an [[8086]]. Thus, 16-bit addresses with 4-bit [[Segment Registers]] for [[Segment Selector|Segment Selection]]. Do note that ''[[Segment Registers]]'' are different from but interconnected with [[Segmentation]]! [[Segment Selector|Segment Selection]] allows for the existence of several separate address spaces ''only'', it is ''not'' a form of protected memory like [[Protected Mode|PM]]'s [[Segmentation]] - you ''cannot'' configure memory protection (which [[Protected Mode]] gets its name from) controls.&lt;br /&gt;
===== System-management Mode =====&lt;br /&gt;
Main article: [[System-management Mode]]&lt;br /&gt;
It's a part of the APIs the [[Motherboard Firmware]] implementation uses for implementing certain features. Namely, the CPU switches to this mode when it receives a [[System Management Interrupt]], that is, a certain [[Hardware Interrupt]] on the [[System Management Interrupt|SMI]] line (which is kind of like the [[Non-Maskable Interrupt|NMI]] line).&lt;br /&gt;
&lt;br /&gt;
Not to be confused with the [[System Management Module]]. Thanks Intel.&lt;br /&gt;
===== Compatibility Mode =====&lt;br /&gt;
===== 64-bit Mode =====&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
	<entry>
		<id>https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=93</id>
		<title>Intel 64 Architecture</title>
		<link rel="alternate" type="text/html" href="https://wiki.friendos.dev/index.php?title=Intel_64_Architecture&amp;diff=93"/>
		<updated>2024-12-18T01:58:56Z</updated>

		<summary type="html">&lt;p&gt;TheCatgirls: Initial version, only general info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Architecture =&lt;br /&gt;
&lt;br /&gt;
The Intel 64 Architecture is a 64-bit extension of the 32-bit [[x86]] [[IA-32]] architecture. It was introduced around 2004, reimplementing [[AMD64]], AMD's 64-bit extension.&lt;br /&gt;
&lt;br /&gt;
Both [[AMD64]] and Intel 64 Architecture (from henceforth referred to as I64A; Do not confuse with [[Itanium]], referred to as [[Itanium|IA64]].) are collectively referred to as [[x86_64]], and commonly as [[x86_64|x64]], or [[x86_64|64bit x86]].&lt;br /&gt;
 &lt;br /&gt;
I64A introduces a new [[x86 Addressing Mode]] to the existing set already present in [[IA32]] referred to as [[IA-32e]], which has two sub-modes, [[IA-32e Compatibility Mode]] and [[IA-32e 64bit Mode]].&lt;br /&gt;
&lt;br /&gt;
= Summary =&lt;br /&gt;
&lt;br /&gt;
I64A is the most common [[x86]] architecture in use today, and as such, we will detail things present in I64A that are also present in other [[x86]] architectures. We will describe average somewhat modern Intel CPU here.&lt;br /&gt;
&lt;br /&gt;
When the system boots up, the [[Intel Managemenet Engine]] (IME) initializes the chipset, then loads the [[Motherboard Firmware]] from its ROM, and jumps to it. The [[Motherboard Firmware]] then initializes the computer, [[Power-On Self Test|POSTs]], and executes its defined [[Firmware Interface]] to load a [[Bootloader]]. &lt;br /&gt;
&lt;br /&gt;
The two main [[Firmware Interface|Firmware Interfaces]] are [[Basic Input-Output System|BIOS]] and [[Unified Extensible Firmware Interface|UEFI]]. [[Basic Input-Output System|BIOS]] is older, back from [[Disk Operating System|DOS]] days. [[Unified Extensible Firmware Interface|UEFI]] is newer, and the current preferred standard for most non-legacy applications.&lt;br /&gt;
&lt;br /&gt;
I64A has several operating modes.&lt;br /&gt;
* [[Protected Mode]] (native)&lt;br /&gt;
* [[Real-address Mode]] (emulated)&lt;br /&gt;
* [[System-management Mode]] (SMM)&lt;br /&gt;
* [[Compatibility Mode]] (IA-32e)&lt;br /&gt;
* [[64-bit Mode]] (IA-32e)&lt;br /&gt;
&lt;br /&gt;
===== Protected Mode =====&lt;br /&gt;
Main article: [[Protected Mode]]&lt;br /&gt;
32-bit [[General-Purpose Register|GPR]] set. Instructions default to 32bit (operand size and address size). Addresses consist of a 16-bit [[Segment Selector]] and 32-bit offset.&lt;br /&gt;
&lt;br /&gt;
Protected Mode (henceforth referred to as PM) supports both [[Paging]] and [[Segmentation]].&lt;br /&gt;
[[Segmentation]] is ''mandatory'', though it can be configured to be essentially a no-op, a so-called [[Flat Segmentation Model]], eg. if you want to use [[Paging]] only.&lt;br /&gt;
&lt;br /&gt;
Segmentation is configured though a [[Global Descriptor Table]].&lt;br /&gt;
===== Real-address Mode =====&lt;br /&gt;
Main article: [[Real-address Mode]]&lt;br /&gt;
16-bit [[General-Purpose Register|GPR]] set. Essentially just emulates an [[8086]]. Thus, 16-bit addresses with 4-bit [[Segment Registers]] for [[Segment Selector|Segment Selection]]. Do note that ''[[Segment Registers]]'' are different from but interconnected with [[Segmentation]]! [[Segment Selector|Segment Selection]] allows for the existence of several separate address spaces ''only'', it is ''not'' a form of protected memory like [[Protected Mode|PM]]'s [[Segmentation]] - you ''cannot'' configure memory protection (which [[Protected Mode]] gets its name from) controls.&lt;br /&gt;
===== System-management Mode =====&lt;br /&gt;
Main article: [[System-management Mode]]&lt;br /&gt;
It's a part of the APIs the [[Motherboard Firmware]] implementation uses for implementing certain features. Namely, the CPU switches to this mode when it receives a [[System Management Interrupt]], that is, a certain [[Hardware Interrupt]] on the [[System Management Interrupt|SMI]] line (which is kind of like the [[Non-Maskable Interrupt|NMI]] line).&lt;br /&gt;
&lt;br /&gt;
Not to be confused with the [[System Management Module]]. Thanks Intel.&lt;br /&gt;
===== Compatibility Mode =====&lt;br /&gt;
===== 64-bit Mode =====&lt;/div&gt;</summary>
		<author><name>TheCatgirls</name></author>
	</entry>
</feed>