2

Recently I've started reading this "book" about OS development (https://littleosbook.github.io/), and I find it great and all that, but I came across a problem while trying to boot up my image in bochs.

At some point the guide about running the operating system in Bochs tells me to create a config file for the emulator. I set every option to what I read.

But when I run the following command,

bochs -f bochsrc.txt -q

it says:

display library 'sdl' not available

The relevant line in the config file is pretty obvious:

display_library: sdl

I don't know what's the problem. I installed both libsdl and libsdl2.0, but it still won't work.

My work environment consists of an Ubuntu 20.04 and a Bochs 2.6.11.

Has anybody faced with this issue? What's the solution?

genpfault
  • 51,148
  • 11
  • 85
  • 139

2 Answers2

4

I found a working fix. I changed the display_library to sdl2 instead of sdl and bosch ran successfully.

Prakhar Londhe
  • 1,431
  • 1
  • 12
  • 26
0

I ran into this issue when running my code on a Vagrant that had no windows manager installed. I think that a windows manager has to be set up in order for bochs to be able to access the relevant libraries or whatever (don't quote me on that lol). After I reinstalled the following dependencies over this Vagrantfile, I managed to get it to work. It worked even better with bochs-x and x.

Vagrant.configure(2) do |config|
  # Ubuntu 15.10
  config.vm.box = "ubuntu/bionic64"

  config.vm.provider "virtualbox" do |vb|
    # Display the VirtualBox GUI when booting the machine
    vb.gui = true
  end

  # Install xfce and virtualbox additions
  config.vm.provision "shell", inline: "sudo apt-get update"
  config.vm.provision "shell", inline: "sudo apt-get install -y xfce4 virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11"
  # Permit anyone to start the GUI
  config.vm.provision "shell", inline: "sudo sed -i 's/allowed_users=.*$/allowed_users=anybody/' /etc/X11/Xwrapper.config"
  # Install OS development requirements
end
Alex Leibowitz
  • 1,364
  • 1
  • 8
  • 12