LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2014, 10:50 AM   #1
mirage1993
Member
 
Registered: Feb 2014
Location: China
Distribution: CentOS6.4
Posts: 51

Rep: Reputation: Disabled
Question This is a Boot Sector written by as86,but I can't understand some directives


Code:
BOOTSEG =0x07c0

entry start
start:
jmpi go,BOOTSEG
go: mov ax ,cs
mov ds,ax
mov es ,ax
mov [msg1+17],ah
mov cx,#20
mov dx,#0x1004
mov bx,#0x00c
mov bp,#msg1
mov ax,#0x1301
int 0x10
loop0: jmp loop0
msg1: .ascii "Loading system..."
.byte 13,10
org 510
.word 0xAA55
I want to know why we should use "jmpi go,BOOTSEG"?

I think when the first sector is read into memory,it is placed in 07c0:0000h.
If the directive "jmpi go,BOOTSEG" is not existed,the next directive is "mov ax ,cs"
And when the directive "jmpi go,BOOTSEG" is existed ,the program would jump to 07c0:go . The next directive is "mov ax ,cs" too!

I want to know does the directive "jmpi go,BOOTSEG" make any sense?
 
Old 06-09-2014, 11:41 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
The BIOS examines the contents of the boot sector and looks for certain details before being willing to transfer control to it. I'm pretty sure starting with that short jmp opcode is one of the requirements.

If the BIOS doesn't approve the boot sector contents, it skips the device in the boot sequence.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Boot sector of installed Vector Linux doesn't have a boot signature ic_torres Linux - Newbie 6 02-15-2011 04:24 PM
Want to use Windows Boot Loader - Install to Boot Sector of Linux Partition? Xenarios Linux - Newbie 7 07-30-2010 03:41 AM
Boot Sector on dual boot PC. Remove Mandrake and replace with FreeBSD Phin666 *BSD 1 10-30-2004 05:02 PM
as86 help needed! eantoranz Programming 8 04-22-2004 03:10 PM
Recompile kernel: patches, as86 vs. as kdaru Linux - Newbie 2 05-19-2002 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration