Closed wiltaylor closed 2 years ago
I am using the following version: "gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0" And it works well. My guess would be that you haven't installed GCC correctly.
What happens when use __asm__ instead asm these happens to be different. stackoverflow
__asm__ volatile("lgdt (%0)" : : "p"(((uint8_t *) i)+2));
Thanks for the reply. It was indeed a bunch of missing packages. I added a few more to my development environment and was able to get it working.
Here is the nix flake with the working development environment.
{
description = "Development Environment For OS tutorial";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in {
devShell.x86_64-linux = pkgs.pkgsi686Linux.mkShell {
buildInputs = with pkgs; [
gcc
nasm
gnumake
valgrind
inetutils
grub2
binutils
xorriso
];
shellHook = ''
${pkgs.figlet}/bin/figlet "OS Development Tutorial"
'';
};
};
}
I am getting the following error when trying to compile the code at the end of video 3.
I have tried a number of things. Tried different versions of GCC (5 and 6 as well as 10.3.0). I have also tried both 32bit and 64bit versions of gcc.