Re: [OSDev] How to switch to long mode in x86 CPUs?

Liste des GroupesRevenir à cl c 
Sujet : Re: [OSDev] How to switch to long mode in x86 CPUs?
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 28. Feb 2025, 09:59:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vprtt6$3jah9$1@dont-email.me>
References : 1
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 27/02/2025 16:57, Ar Rakin wrote:
Hello there,
 I am trying to develop my own, simple operating system to learn more
about how kernels work and low level stuff like that.  However, I am
stuck at setting up paging while switching long mode (64-bit protected
mode) in x86 processors.
 
Are you trying to learn about OS kernels, or about the complexities of low-level x86 stuff?  Those are different things.
If you want to learn about how operating systems work, you might consider starting on microcontrollers.  There are lots of RTOS's available to study, and it is much easier to understand what is going on - there is none of the multi-layered disaster of x86 modes to deal with.
Once you are happy with threads, context switches, locks, priorities, and all the rest of that stuff, you can start moving up and adding features for MMU's, SMP, and more, using bigger target processors.
On the other hand, if you are interested in learning the intricacies of the x86 world, you need to look elsewhere for information - as Keith says, it is not really C related when you are writing assembly. comp.arch might be a helpful group.
However, it is possible to use C for almost all code here.  But it will not be standard C - it is not even standard free-standing C.  You will make use of compiler extensions, bits of inline assembly, pre-main C code (so none of the library will be initialised, and program-lifetime data will not be set up), and other such highly non-portable code.  I remember reading once about LinuxBIOS (now coreboot) having just four lines of assembly running out of reset, before everything else was in C.

Date Sujet#  Auteur
27 Feb 25 * [OSDev] How to switch to long mode in x86 CPUs?29Ar Rakin
27 Feb 25 +* Re: [OSDev] How to switch to long mode in x86 CPUs?14Keith Thompson
28 Feb 25 i`* Re: [OSDev] How to switch to long mode in x86 CPUs?13Ar Rakin
28 Feb 25 i +- Re: [OSDev] How to switch to long mode in x86 CPUs?1Waldek Hebisch
28 Feb 25 i `* OT: (Was: How to switch to long mode in x86 CPUs?)11Salvador Mirzo
28 Feb 25 i  +* Re: OT: USENET9Salvador Mirzo
1 Mar 25 i  i+* Re: OT: USENET7Richard Harnden
1 Mar 25 i  ii+* Re: OT: USENET2Ar Rakin
5 Mar 25 i  iii`- Re: OT: USENET1candycanearter07
2 Mar 25 i  ii`* Re: OT: USENET4Salvador Mirzo
2 Mar 25 i  ii `* Re: OT: USENET3Ar Rakin
2 Mar 25 i  ii  +- Re: OT: USENET1yeti
9 Mar 25 i  ii  `- Re: OT: USENET1Salvador Mirzo
1 Mar 25 i  i`- Re: OT: USENET1Ar Rakin
1 Mar 25 i  `- Re: OT:1Ar Rakin
28 Feb 25 +* Re: [OSDev] How to switch to long mode in x86 CPUs?12David Brown
28 Feb 25 i+* Re: [OSDev] How to switch to long mode in x86 CPUs?2Ar Rakin
1 Mar 25 ii`- Re: [OSDev] How to switch to long mode in x86 CPUs?1Dan Cross
1 Mar 25 i`* Re: [OSDev] How to switch to long mode in x86 CPUs?9Paul Edwards
2 Mar 25 i +* Re: [OSDev] How to switch to long mode in x86 CPUs?3Salvador Mirzo
2 Mar 25 i i+- Re: PC BIOS (was [OSDev] How to switch to long mode in x86 CPUs?)1Dan Cross
2 Mar 25 i i`- Re: [OSDev] How to switch to long mode in x86 CPUs?1Dan Cross
2 Mar 25 i `* Re: [OSDev] How to switch to long mode in x86 CPUs?5Paul Edwards
2 Mar 25 i  `* Re: [OSDev] How to switch to long mode in x86 CPUs?4bart
4 Mar 25 i   `* Re: [OSDev] How to switch to long mode in x86 CPUs?3Paul Edwards
4 Mar 25 i    `* Re: [OSDev] How to switch to long mode in x86 CPUs?2bart
5 Mar 25 i     `- Re: [OSDev] How to switch to long mode in x86 CPUs?1Paul Edwards
1 Mar 25 +- Re: [OSDev] How to switch to long mode in x86 CPUs?1Dan Cross
2 Mar 25 `- Re: [OSDev] How to switch to long mode in x86 CPUs?1Andy Valencia

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal