LinuxQuestions.org
Help answer threads with 0 replies.
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 09-15-2004, 02:08 PM   #1
goldeneagle
LQ Newbie
 
Registered: Sep 2004
Posts: 1

Rep: Reputation: 0
Question making floppy bootable with UniOS 1.1


hi
i was converting an ordinary floppy into bootable via the following code which i downloaded from some site i dont remember. it works perfectly well but i m unable to understand some parts of the assembly code .if some one will please explain my questioins
source: (there is a makefile also)
------------
.code16
.text
.org 0x00

.global _start <============== why this "start" begins with an underscore while other labels do not?
_start:
mov $0x07C0,%ax
mov %ax,%ds

call booting
xor %dx,%dx
call working
call idleloop
ret

booting:
mov $boot,%si
call message
call nl
ret

message:
cld
lodsb
or %al,%al
jz done
mov $0xE,%ah
mov $7,%bx
int $0x10
jmp message

done:
ret

nl:
mov $newline,%si
call message
ret

working:
call nl
call nl
mov $device,%si
call message
call waitenter
inc %dx
cmp $3,%dx
je keyboard
jmp working

waitenter:
call nl
movw $cont,%si
call message
xor %ax,%ax
int $0x16
cmp 'T',%al
jz taz
cmp 't',%al
jz taz
cmp $13,%al
jnz waitenter
ret

keyboard:
call nl
call nl
movw $kbd,%si
call message
call nl
movw cont,%si
call message
ret

taz:
call nl
call nl
movw tazq,%si
call message
jmp waitenter

idleloop:
hlt
jmp idleloop

boot:
.ascii "Loading UniOS 1.1 Beta..."
newline:
.byte 10, 13, 0
device:
.ascii "Device not responding to SCSI command."
cont:
.ascii "Hit ENTER to continue..."
kbd:
.ascii "Keyboard not responding to SCSI command."
tazq:
.ascii "Yes, TazQ is an Internet crack monkey on wheels."


<========================== what is the function of the following few lines?
padlen:
.byte boottag - .

.fill 10,1,0


.org 510
boottag:
.word 0xAA55

=============== it seems the above few lines are writing AA55 to 510... th byte of boot sector which ofcourse will tell the BIOS that it is a bootable.but if these three lines can do the job why do we need the whole program?they r never referenced in the program will only this three lines make it a bootable?

thanks in advance.
 
  


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
making a non bootable patrion bootable jason2 Linux - General 6 08-01-2004 10:25 AM
Installing Slackware with non-bootable CD or bootable floppy (but not both) TiddlyPom Slackware 2 03-22-2004 04:15 PM
Making Slackware bootable floppy webboss Linux - General 3 11-06-2003 04:59 AM
Making a bootable floppy disk SMB3Master General 4 10-26-2003 06:25 AM
Making Cd bootable for RH Taltosit Red Hat 6 09-01-2003 03:18 PM

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

All times are GMT -5. The time now is 10:24 PM.

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