From d6efe62c80ddaa5bae072837d273a17a66d029f6 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 1 Feb 2016 23:57:09 +0100 Subject: [PATCH] Add some explanation for the long mode check --- posts/2015-08-25-entering-longmode.md | 1 + 1 file changed, 1 insertion(+) diff --git a/posts/2015-08-25-entering-longmode.md b/posts/2015-08-25-entering-longmode.md index 88aee1f8..7aab5861 100644 --- a/posts/2015-08-25-entering-longmode.md +++ b/posts/2015-08-25-entering-longmode.md @@ -163,6 +163,7 @@ check_long_mode: mov al, "2" jmp error ``` +It tries to invoke a CPUID function to test if the long mode is available. But this function is not part of CPUIDs core functions, therefore we need to test if the so-called extended functions are available before. So the first `cpuid` call tests whether the function is available that checks long mode support. And then the second `cpuid` call uses that function to test whether long mode support is available. Whew! ### Putting it together We just call these check functions right after start: