Click here to Skip to main content
15,916,846 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As it is suggested in this article to do this example on ubuntu, but I'm doing it on centos 7? Does it matter?

And another problem, is about bochs-x. it is not getting installed? hence I tried it using qemu but it is not working.

What I have tried:

I tried installing bochs on centos7 using following command:
sudo yum install bochs-x

but its showing No package bochs-x available.
Error: Nothing to do
Posted
Updated 9-Apr-18 23:52pm
Comments
Richard MacCutchan 8-Apr-18 7:36am    
What?
Member 13768174 9-Apr-18 8:45am    
sorry if my question was improper..

actually I was trying to write a simple bootloader in assembly.

assembly code:

code16 #generate 16-bit code
.text #executable code location
.globl _start;
_start: #code entry point

movb $'X' , %al #character to print
movb $0x0e, %ah #bios service code to print
int $0x10 #interrupt the cpu now

. = _start + 510 #mov to 510th byte from 0 pos
.byte 0x55 #append boot signature
.byte 0xaa #append boot signature

Before that I created a floppy disk image of 1.4mb size using following command:
dd if=/dev/zero of=floppy.img bs=512 count=2880

then I compiled the assembly code and created a ".bin" file

then I copied the code on the boot sector of the floppy.img using following command:
dd if=test.bin of=floppy.img

and then ran the qemu-system-x86_64.

But qemu is not detecting my floppy.img...

So can you please help me out?
Richard MacCutchan 9-Apr-18 12:44pm    
Sorry, I have no experience of qemu, but I think you need to do some more reading about boot loaders.
Member 13768174 9-Apr-18 22:40pm    
Ok, sure...Can you suggest some books please?

QEMU[^]
 
Share this answer
 
You are probably referring to the article Writing a boot loader in Assembly and C - Part 1[^].

This is a large site with millions of members and many thousands of them have written articles. If you a have question related to an article use the forum on the bottom of the article first because the author might help better than others.

CentOS is based on Red Hat Enterprise Linux (RHEL) while Ubuntu is based on Debian. If something described for a Debian based Linux distribution is not working with a RHEL based one do a web research first to find out the differences and the corresponding commands / package names etc.

If a package is not found for a distribution, check first for similar names using the distribution's package manager (e.g. searching for "bochs*" in your case). Or search the web for the basic package name and your Linux distribution. If there is no package available you can usually build it from the sources.

It seems that you have to do that because I found only a package for CentOS 6 (bochs-2.6-3.puias6.i686.rpm CentOS 6 Download[^]). But visit that link because it lists the required libraries.

Visit the Bochs project site at Bochs x86 PC emulator download | SourceForge.net[^] to get the sources and building instructions.

There is also a RPM package at Bochs x86 PC emulator - Browse /bochs/2.6.9 at SourceForge.net[^]. So you might try to download and install that first before building it from the sources.
 
Share this answer
 
Comments
Member 13768174 10-Apr-18 6:26am    
Yes you are right. I was actually referring to the article Writing a boot loader in Assembly and C - Part 1[^].

Actually I was reading that article, and by mistake I posted that question somewhere else assuming that I'm at the bottom that article. I realised that later. But any way I still appreciate your help. Thank you very much.

For now I have installed the bochs 2.6.9 on my system. Still struggling with some stuff like configurations of disk & boot options, bochs display and interface options.
Jochen Arndt 10-Apr-18 7:01am    
Thank you for your feedback and accepting my solution.

I can't help much with Boch because I have not used it so far. But the project seems to be quite active and provides more documentation than other projects so that you should got it working.
Member 13768174 11-Apr-18 23:41pm    
Welcome..Can you suggest me some books related to bootloader?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900