(Solved) Slow Bochs on Linux

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

(Solved) Slow Bochs on Linux

Post by Octacone »

I have a massive massive problem. When I run Bochs on Windows it is as smooth as ****, but when I run it on Linux it is as slow as ****. This is driving me crazy since I can't do any of debugging. I am running the latest Ubuntu 16.10, also I have an SSD. Like what could be the problem? When I run Bochs it all starts to blink, my computer freezes, I can't press any of the buttons on it (Bochs buttons), it takes 10 seconds for 1 character to print. Imagine something being as slow as **** and then imagine it again and then square it and then square it again with the square you got -> extremely slow, painfully slow. I tried reinstalling it, but no help.

P.S Sorry if I posted inside a wrong forum section. Didn't know where to put it, fits in here the most.
Last edited by Octacone on Sat Feb 11, 2017 6:23 am, edited 2 times in total.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Slow Bochs on Linux

Post by BrightLight »

Attach your bochsrc file.
What version of Bochs is it, too? Did you compile it yourself? If so, what configure options did you use?
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: Slow Bochs on Linux

Post by Octacone »

omarrx024 wrote:Attach your bochsrc file.
What version of Bochs is it, too? Did you compile it yourself? If so, what configure options did you use?
I didn't compile it myself.
Here is my configuration file:

Code: Select all

log: xxx_hidden
memory: guest=512, host=512
cpu: count=1, ips=50000000, reset_on_triple_fault=0, cpuid_limit_winnt=0 
cpuid: mmx=1, sep=1, sse=sse2, aes=0, movbe=0, xsave=0
port_e9_hack: enabled=1
romimage: file="/usr/share/bochs/BIOS-bochs-latest", address=0xfffe0000
vgaromimage: file="/usr/share/bochs/VGABIOS-lgpl-latest"
vga_update_interval: 25000
mouse: enabled=1, toggle=f12
panic: action=ask
error: action=report
info: action=report
debug: action=report
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata0-slave:  type=cdrom, path="xxx_hidden", status=inserted
boot: cdrom
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Slow Bochs on Linux

Post by BrightLight »

Maybe replace "vga_update_interval" line with this:

Code: Select all

vga: extension=vbe, update_freq=5, realtime=1
Adding this line may speed it up too, although the time emulation will not be accurate:

Code: Select all

clock: sync=none, time0=local, rtc_sync=0
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

(Solved) Slow Bochs on Linux

Post by Octacone »

omarrx024 wrote:Maybe replace "vga_update_interval" line with this:

Code: Select all

vga: extension=vbe, update_freq=5, realtime=1
Adding this line may speed it up too, although the time emulation will not be accurate:

Code: Select all

clock: sync=none, time0=local, rtc_sync=0
Thanks! I guess it was because of it. I also modified some other parameters and now my configuration file looks like this:

Code: Select all

ata0-master: type=cdrom, path="xxx", status=inserted
boot: cdrom
display_library: sdl
cpu: count=1 ips=200000000, reset_on_triple_fault=0
memory: guest=512, host=512
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
romimage: file=$BXSHARE/BIOS-bochs-legacy, address=0xffff0000
vga: extension=vbe, update_freq=5
log: xxx
port_e9_hack: enabled=1
mouse: enabled=1, toggle=f12
cpuid: mmx=1, sep=1, sse=sse4_2
clock: sync=none, time0=local, rtc_sync=1
Now it is even faster than Windows. It loads instantly.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: (Solved) Slow Bochs on Linux

Post by BrightLight »

Talking from the point of view of someone who is doing OS development, this problem shouldn't need to be posted in a forum asking for help. Instead, you should have compared the bochsrc on Windows and Linux, and determined the problem yourself. All I did was compare your bochsrc with mine. ;)
You know your OS is advanced when you stop using the Intel programming guide as a reference.
alexfru
Member
Member
Posts: 1112
Joined: Tue Mar 04, 2014 5:27 am

Re: (Solved) Slow Bochs on Linux

Post by alexfru »

omarrx024 wrote:this problem shouldn't need to be posted in a forum asking for help. Instead, you should have compared the bochsrc on Windows and Linux, and determined the problem yourself.
For that one needs to be certain that the same configuration file has the same (or nearly the same) effect on both systems and isn't hiding some important implementation detail behind the abstraction of the options contained in the file. Clearly, the OS APIs that bochs ends up calling are different in different OSes and they may not be sufficiently equivalent in terms of performance or ease of use, which may result in different user experience.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

(Solved) Slow Bochs on Linux

Post by Octacone »

omarrx024 wrote:Talking from the point of view of someone who is doing OS development, this problem shouldn't need to be posted in a forum asking for help. Instead, you should have compared the bochsrc on Windows and Linux, and determined the problem yourself. All I did was compare your bochsrc with mine. ;)
I guess so, but I couldn't compare it. Windows one was auto generated and had like 100 more options that I didn't need. It is all solved now. It is hard to haunt when you don't know what to haunt. :wink:
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
Post Reply