bochs | Bochs IA-32 Emulator Project | Emulator library

 by   lubomyr C++ Version: Current License: Non-SPDX

kandi X-RAY | bochs Summary

kandi X-RAY | bochs Summary

bochs is a C++ library typically used in Utilities, Emulator applications. bochs has no bugs and it has low support. However bochs has 3 vulnerabilities and it has a Non-SPDX License. You can download it from GitHub.

bochs - the cross platform ia-32 (x86) emulator updated: sun jan 5 08:36:00 cet 2020 version: 2.6.11. bochs is a highly portable open source ia-32 (x86) pc emulator written in c++, that runs on most popular platforms. it includes emulation of the intel x86 cpu, common i/o devices, and a custom bios. bochs can be compiled to emulate many different x86 cpus, from early 386 to the most recent x86-64 intel and amd processors which may even not reached the market yet. bochs is capable of running most operating systems inside the emulation, for example dos, linux or windows. bochs was written by kevin lawton and is currently maintained by the bochs project at "bochs can be compiled and used in a variety of modes, some which are still in development. the 'typical' use of bochs is to provide complete x86 pc emulation, including the x86 processor, hardware devices, and memory. this allows you to run os's and software within the emulator on your workstation, much like you have a machine inside of a machine. bochs will allow you to run windows applications on a solaris machine with x11, for example. bochs is distributed under the gnu lgpl. see license and copying for
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              bochs has a low active ecosystem.
              It has 117 star(s) with 33 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 12 open issues and 3 have been closed. On average issues are closed in 39 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of bochs is current.

            kandi-Quality Quality

              bochs has no bugs reported.

            kandi-Security Security

              bochs has 3 vulnerability issues reported (0 critical, 2 high, 0 medium, 1 low).

            kandi-License License

              bochs has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              bochs releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bochs
            Get all kandi verified functions for this library.

            bochs Key Features

            No Key Features are available at this moment for bochs.

            bochs Examples and Code Snippets

            No Code Snippets are available at this moment for bochs.

            Community Discussions

            QUESTION

            Qemu-img 5.2.91 can't open vmdk, Failed to lock byte 100: Input/output error, but qemu-img 2.5 work
            Asked 2021-Apr-25 at 03:29
            openstack:~/qemu-6.0.0-rc1/build$ qemu-img --version
            qemu-img version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.51), Copyright (c) 2004-2008 Fabrice Bellard
            openstack:~/qemu-6.0.0-rc1/build$ sudo qemu-img check /mnt/esxi/name.vmdk
            No errors were found on the image.
            
            openstack:~/qemu-6.0.0-rc1/build$ ./qemu-img -V
            qemu-img version 5.2.91
            Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
            openstack:~/qemu-6.0.0-rc1/build$ sudo ./qemu-img check /mnt/esxi/name.vmdk
            qemu-img: Could not open '/mnt/esxi/name.vmdk': Failed to lock byte 100: Input/output error
            
            ...

            ANSWER

            Answered 2021-Apr-25 at 03:29

            Because the vmdk file in NFS directory, add this option -o nolock fixed it.

            nolock — Disables file locking. This setting is occasionally required when connecting to older NFS servers. noexec — Prevents execution of binaries on mounted file systems. This is useful if the system is mounting a non-Linux file system via NFS containing incompatible binaries.

            Source https://stackoverflow.com/questions/67215676

            QUESTION

            Need help understanding Makefile in xv6
            Asked 2021-Mar-25 at 21:59

            I have been reading the makefile of xv6 project. I want to put all the user programs into a folder to keep the project tidy. I can not find where it compiles the user programs. I know that when i run: make fs.img; it will compile the user programs, but i can not find any commands to do so. I also want all the kernel code to go into a directory called "kernel".
            Is there a feature in make that allows automatic compilation or is there just something I'm not seeing. And could anyone suggest any make docs to help me understand this makefile.

            My Makefile:

            ...

            ANSWER

            Answered 2021-Mar-25 at 12:30

            All make systems (as required by POSIX) have a number of built-in rules including rules that know how to compile object files from C files.

            For information on GNU make's built-in rules you can review the manual.

            Source https://stackoverflow.com/questions/66795490

            QUESTION

            Bochs Emulator -> Blinking Booting from Floppy?
            Asked 2021-Feb-09 at 10:14

            I have a problem with my Bochs Emulator / Assembly Code, here is the Problem:

            ...

            ANSWER

            Answered 2021-Feb-09 at 10:14

            codeseg equ gdt_codedesc - gdt_start dataseg equ gdt_ -> codedesc Must be datadesc - gdt_start

            Source https://stackoverflow.com/questions/66108488

            QUESTION

            C bitwise AND gives different result with -O0 and -O2
            Asked 2021-Jan-31 at 15:14

            I'm working on a PC emulator using both Bochs and DOSBox as references.

            When emulating the "NEG Ed" instruction (two's complement negation of a doubleword) I'm getting different results if I compile with -O0 rather than -O2.

            This is a test program with just the relevant bits:

            ...

            ANSWER

            Answered 2021-Jan-31 at 13:31

            There are some issues in your code:

            • the value returned by strtol("0x80000000", NULL, 16) depends on the range of type long: if type long has 32 bits, the returned value should be LONG_MAX, which is 2147483647, whereas if long is larger, 2147483648 will be returned. Converting these values to uint32_t does not change the value as both as within the range of uint32_t. Type long on your system seems to have 64 bits. You could avoid this implementation defined behavior using strtoul() instead of strtol().

            • there is no need for the intermediary cast to (int32_t): negating the unsigned value is well defined and -0x80000000 has the value 0x80000000 for type uint32_t.

            • furthermore, this conversion is counterproductive and the likely cause of the observed behavior as negating the value INT32_MIN has undefined behavior because of signed arithmetic overflow. With optimisations enabled, the compiler determines that you are extracting the sign as if by bool sign = -(int32_t)value < 0 and simplifies this expression as bool sign = (int32_t)value > 0, which is correct for all values except INT32_MIN for which the compiler considers any behavior to be OK, since the behavior is undefined anyway. You can check the code on Godbolt's Compiler Explorer.

            • you use type bool without including : the program should not compile. Is this a copy/paste error or do you compile as c++? The C99 _Bool semantics add an implicit test in the intialization statement, but it would be better to make it explicit and write:

            Source https://stackoverflow.com/questions/65977673

            QUESTION

            What are IO ports, serial ports and what's the difference between them?
            Asked 2020-Dec-27 at 03:45

            I'm confused.

            I have recently started working on building an operating system while using bochs as an emulator and a certain manual online.

            In the manual to move the vga framebuffer cursor I'm using the IO ports using the command 'out'. I get how to control it but I don't know what is it that I'm controlling, and after some reading it seems like everywhere it was addressed as an abstract thing that for example makes the cursor to change its position on the screen.

            What I want to know: what are they physically? are they cables? if yes from where to where they are connected? can I input from them also as there name suggest? and why do I need the out command and cant write directly to their place in the memory?

            If in your answer you can also include the serial ports and the difference between them and the IO ones it will be amazing,

            with respect, revolution

            (btw the operating system is 32 bits)

            ...

            ANSWER

            Answered 2020-Dec-27 at 03:45

            An IO port is basically memory on the motherboard that you can write/read. The motherboard makes some memory available other than RAM. The CPU has a control bus which allows it to "tell" the motherboard that what it outputs on the data bus is to be written somewhere else than RAM. When you output to the VGA buffer, you write to video memory on the motherboard. The out/in instructions are used to write/read IO ports instead of writing to RAM. When you use out/in instructions, you instruct the CPU to set a certain line on its control bus to tell the motherboard to write/read a certain byte to an IO port instead of RAM.

            Today, a lot of RAM memory is used for hardware mapping instead of IO ports. This is often called the PCI hole. It is memory mapped IO. So you will write to RAM and it will send the data to hardware like graphics memory. All of this is transparent to OS developers. You are simply using very abstract hardware interfaces which are either conventional (open source) or proprietary.

            Serial ports in the meantime are simply ports which are serial in nature. A serial port is defined to be a port where data is transferred one bit at a time. USB is serial (universal serial bus). VGA is serial and others are too. These ports are not like IO ports. You can output to them indirectly using IO ports.

            IO ports offer various hardware interfaces which allow to drive hardware. For example, if you have a VGA compatible screen and set text mode, the motherboard will make certain IO ports available and, when you write to these IO ports, video memory will vary depending on what you output to these ports. Eventually, the VGA screen will refresh when the video controller will output data written to video memory through the actual VGA port. I'm not totally aware of how all of this works since I'm not an electrical engineer and I never read about this stuff. To what I know, you can see the pins of the VGA port and what they do independently on wikipedia. VGA works with RGBHV. RGB stands for red, green and blue while HV stand for horizontal/vertical sync. As stated on wiki in the article on analog television:

            Synchronizing pulses added to the video signal at the end of every scan line and video frame ensure that the sweep oscillators in the receiver remain locked in step with the transmitted signal so that the image can be reconstructed on the receiver screen. A sync separator circuit detects the sync voltage levels and sorts the pulses into horizontal and vertical sync.

            The horizontal synchronization pulse (horizontal sync, or HSync), separates the scan lines. The horizontal sync signal is a single short pulse which indicates the start of every line. The rest of the scan line follows, with the signal ranging from 0.3 V (black) to 1 V (white), until the next horizontal or vertical synchronization pulse.

            Memory in itself takes various forms in hardware. Video memory is often called VRAM (Video RAM) or the Frame Buffer as you can read in a Wikipedia article. So in itself video memory is an array of DRAM. DRAM today is one capacitor (which stores the data) and one mosfet transistor (which controls the flow of the data). So you have special wiring on the motherboard between the data bus of the processor and the VRAM. When you output data to video memory, you write to VRAM on the motherboard. Where you write and how just depends on the video mode you set up.

            Most modern systems work with HDMI/Display port along with graphics card. These graphics card are other hardware interfaces which are often complex and they often cannot be known because the drivers for the cards are provided by the manufacturers. osdev.org has information on Intel HD Graphics which has a special interface to interact with. It can be used to gather info on the monitor and to determine what RAM address to use to write to the monitor.

            Source https://stackoverflow.com/questions/65461799

            QUESTION

            I can't seem to get this 16-bit memory detection assembly code to work
            Asked 2020-Dec-17 at 06:01

            A while ago I was working on a simple bootloader project and I decided to start working on it again. Anyways, I'm trying to detect memory using BIOS INT=15H EAX=E820h. I used the interrupt in a loop and allocated space for a memory map to hold all the entries. Now I'm trying to parse the entries starting from the last entry. My goal is to find the highest 1MB area I can use to hold a file I'm reading from the disk.

            This is my code so far. It's being tested on Bochs 2.6.11, with 32MB of RAM and everything else set to default settings. Of course, it's 16-bit real mode code.

            ...

            ANSWER

            Answered 2020-Dec-17 at 06:01

            Originally int 0x15, eax=0xE820 returned a 20-byte structure. This was extended to 24 bytes by a version of ACPI (I think it was ACPI 3.0 but didn't check and could be wrong) that introduced a new "flags" field to the structure.

            This code allocates space on the stack for the 20 byte structure (without the extra flags field):

            Source https://stackoverflow.com/questions/65332113

            QUESTION

            Cannot find page table entry
            Asked 2020-Nov-05 at 10:37

            I cannot find records in the page table/page directory for address 0xB8000. It works correct and when I put some symbols into this memory region display shows it.

            I’m in the protected mode, and paging is enabled. I’m using bochs.

            cr0 is 0xe0000011 or 1110 0000 0000 0000 0000 0000 0001 0001b, cr3 is 0x1000

            0xB8000 is equal 1011 1000 0000 0000 0000b, so 10111000b is index of page table, it's equal 184, index of page directory is 0, offset is zero.

            I go to 0x1000 of physical memory and I get first (index 0) item:

            It is 0x2027 or 10 0000 0010 0111b so the physical address of the page table is 10b or 2. I need a content of 184th entry so I need to go to 184 * 4 + 2 = 738 = 0x2E2, but it's empty:

            Btw I have three memory descriptors (memory from 0x0 to 0xFFFFFFFF):

            ...

            ANSWER

            Answered 2020-Nov-05 at 10:37

            It is 0x2027 or 10 0000 0010 0111b so the physical address of the page table is 10b or 2. I need a content of 184th entry so I need to go to 184 * 4 + 2 = 738 = 0x2E2, but it's empty:

            It's 0x2027, so the physical address of the page table is 0x2000 (not 2). The 185th entry (entry number 184) will be at offset 0x2E0 in the page table and will have the physical address 0x22E0.

            Note: You could shift the page directory entry (0x2027) to the right 12 places and say "it's physical page number 2", then multiply the page number by the size of a page (or shift it left 12 places) to find the physical address of the page. It's easier/faster to just mask off the lowest 12 bits instead (e.g. physical_address_of_page_table = page_directory_entry & 0xFFFFF000;), especially when doing it in your head with hexadecimal values (where you can just assume the last 3 digits are zeros).

            Source https://stackoverflow.com/questions/64693477

            QUESTION

            Why is paging not working and getting physical address not available error on Bochs
            Asked 2020-Sep-20 at 18:27

            I have the following assembly code to set up paging for long mode.

            ...

            ANSWER

            Answered 2020-Sep-20 at 18:27

            As stated in Intel's documentation ...

            Source https://stackoverflow.com/questions/63981828

            QUESTION

            Bochs: display library 'sdl' not available
            Asked 2020-Sep-06 at 17:26

            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?

            ...

            ANSWER

            Answered 2020-Aug-01 at 20:10

            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.

            Source https://stackoverflow.com/questions/63159511

            QUESTION

            FAT16 Bootloader only Loading First Cluster of a File
            Asked 2020-Jul-29 at 15:30

            I am currently in the process of fixing a bootloader I wrote to load my custom real-mode x86 kernel (SYS.BIN). I managed to get it to read the root directory and FAT, and load a small-ish kernel from the filesystem, all within the bootsector. However, I began testing it with larger kernels, and it seems that the bootloader will not load more than one cluster. I checked my code against another similar bootloader, and it seems to be doing effectively the same thing when it comes to loading multi-cluster files. The main difference is that I am loading the first FAT into segment 0x3000 and the root directory into segment 0x3800, so that they will be accessible to the kernel. (Did I mess up segmentation at all?)

            I should probably mention that I'm testing this by compiling with NASM, writing the resulting BOOT.BIN file to the first sector of a raw 32M image, mounting it on a loop device, copying SYS.BIN over, and creating a new image of that loop device, which I then throw into QEMU as a hard drive. I know with certainty that it is only loading the first cluster of the file.

            In particular, I believe the code that is causing the issue is likely in here:

            ...

            ANSWER

            Answered 2020-Jul-29 at 15:30

            Your mov ax, word [ds:si] has an unneeded ds segment override.

            This is also related to your problem with the variables, the memory accesses use ds as the default segment. So after mov ax, 0x3000 \ mov ds, ax you are not accessing your original variables any longer.

            You have to reset ds to 7C0h, as your loader uses the default org 0. Your print_str function does reset ds like that. But the mov si, word [cluster] and everything between the FAT word access in .next_cluster and up to .jump uses the wrong ds. To correct this, change your code like this for example:

            Source https://stackoverflow.com/questions/63144980

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install bochs

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/lubomyr/bochs.git

          • CLI

            gh repo clone lubomyr/bochs

          • sshUrl

            git@github.com:lubomyr/bochs.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Emulator Libraries

            yuzu

            by yuzu-emu

            rpcs3

            by RPCS3

            Ryujinx

            by Ryujinx

            ruffle

            by ruffle-rs

            1on1-questions

            by VGraupera

            Try Top Libraries by lubomyr

            uae4all2

            by lubomyrC

            uae4arm

            by lubomyrC++

            BochsLauncher

            by lubomyrJava

            freespace2

            by lubomyrC++

            GlobalTv-Android

            by lubomyrJava