OrdoFlammae / littleosbook

Source for the little book about OS development
http://ordoflammae.github.io/littleosbook
76 stars 14 forks source link

A few minor issues in chapter 2 #18

Open arun-mani-j opened 3 months ago

arun-mani-j commented 3 months ago

Hii, thanks for stepping up to keep the project alive.

I'm tried the chapter 2 and found some issues regarding the packages one needs to install.

  1. In "Quick Setup", one also needs to install mtools, otherwise they will get - grub-mkrescue: error:mformatinvocation failed. Also grub-pc-bin does not seem to be required anymore.
  2. In "Running Bochs", it should be sdl2 over sdl.

I'm on Debian Testing edition, so there is very good chance that future editions of Ubuntu and other Debian based distros will have to reflect it too. I'm not sure how it is on other distros like Fedora or Arch.

I can make a pull request if you like.

Side note:

  1. I'm getting bx_dbg_read_linear: physical memory read error (phy=0x0000322f3331, lin=0x00000000322f3331) Next at t=662802 after pressing c after running bochs. And my registers are all 0, what could I be doing wrong?
  2. Can you open Discussions in this repository so people can use it for help instead of spamming the issues. :see_no_evil:

Thank you!

OrdoFlammae commented 2 months ago

Howdy! I've opened up Discussions, that was a good idea. I've been pretty busy lately, and have not had too much time to ensure that everything is working for the book here, so I appreciate the comments. I'll look into your suggestions, but it would definitely speed things up if you opened up a PR yourself. Going back over the dependencies is something that's on my list of things to do, there have been a lot of things that need to be updated, including potentially adding some sections on UEFI.

For your side note, I can't think of a particular reason that might be happening, but feel free to open a discussion. It might be useful to include your code as well. I may or may not be able to spot the problem.

arun-mani-j commented 2 months ago

Thanks a lot! Let me get the PR ready.

Wish I could help on UEFI, but me myself a beginner in these things, but if you have any extra resources and kind of plan, perhaps I could try my best :)

OrdoFlammae commented 2 months ago

Yeah, even I am not amazingly familiar with UEFI, so unless someone from the community wants to step up and add large sections to the book, that's most likely a project that will have to wait for some time, until I have a chance to learn all the different details and distill them into something that fits within this book (or potentially a separate work).

For your PR, I would like to get your issue resolved first, as I am still uncertain whether or not it is actually functional until a full working example is produced.

arun-mani-j commented 2 months ago

For your PR, I would like to get your issue resolved first, as I am still uncertain whether or not it is actually functional until a full working example is produced.

Thanks. My PR is regarding the missing packages, so don't think it has anything to do with the issue I'm facing. Regarding working example, I'm able to reproduce the issue as it is from the code sample on the book. However, if you prefer, let me upload the files as a zip too in the discussions :)

ThomasThongCE commented 3 weeks ago

I also encountered the bx_dbg_read_linear error. After some investigation, I found that this issue might be related to a bug in the BIOS included in the Debian Bochs package. There is a discussion in StackOverflow about the problem (link).

To resolve this, I installed the RPM package from the official Bochs source forge, which successfully resolved the issue.

Here are the steps I took:

  1. Install alien to convert the .rpm file into a .deb file:

  2. Install the converted .deb file.

  3. If you encounter a "trying to overwrite ..." error: Use the following command to remove any conflicting packages: sudo dpkg -P bochsbios This might be necessary because you already have the Bochs package installed from Debian.

Hope this helps anyone who gets stuck!

arun-mani-j commented 3 weeks ago

Hii, a good new is, this issue has been fixed upstream in Debian! https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1082917 So future Debian and derivatives will not have this bug.

arun-mani-j commented 3 weeks ago

I also encountered the bx_dbg_read_linear error. After some investigation, I found that this issue might be related to a bug in the BIOS included in the Debian Bochs package. There is a discussion in StackOverflow about the problem (link).

To resolve this, I installed the RPM package from the official Bochs source forge, which successfully resolved the issue.

Here are the steps I took:

1. Install `alien` to convert the `.rpm` file into a `.deb` file:

2. Install the converted .deb file.

3. If you encounter a "trying to overwrite ..." error:
   Use the following command to remove any conflicting packages:
   `sudo dpkg -P bochsbios`
   This might be necessary because you already have the Bochs package installed from Debian.

Hope this helps anyone who gets stuck!

A good solution!

For those who don't feel comfortable with mixing packages, you can just extract the BIOS image from the RPM package and use it locally.

More info here - https://github.com/OrdoFlammae/littleosbook/discussions/20#discussioncomment-10782450.