hello erik!
I really do not want to anger you too much but let me have an interruption on
your words right now.
I do not know if you are going to develop something os-independant like me, but
if you are, the things i've told you were right up to the income of your mail
and that really pisses me off !!!
so these were my theses:
1st) you won't need a starting jump
2nd) you won't need a BiosParameterBlock
3rd) you won't need to worry about 0x1FE significance
since i'm developing an os-independant boot manager that works with every OS
product, and, shall work on every bios loading strategy, I had to do some
research on different systems from 486 to P4. But when you tell me that on your
COMPAQ P3 this won't be the same, i'm afraid.
this means to me, that thos COMPAQ bios romcodes aren't builded to work with my
code !!
Because of this, I'd like to send you a short example out of my source that
works fine on both: a) floppies and b) ide's.
but it's definitely now being designed to make a floppy bootable and as you
will see, no JMP and no other signs are put in.
on all systems that i've tested up to now, and i'd like to swear about that,
they're not needed up to now!!
perhaps you've got the time to make that being assembled and written down to
one of your floppies in order to have me a short mail 8^] !!
The only thing i could not do for you is to make it be NASM compatible.
I use borland's turbo assembler with /m2 switch.
greetings from over here in rainy cold -but good old germany,
Florian.
So here you go:
;ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ
;Û code written by f. liebig Û
;Û loader.asm Û
;ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
; DEFINITIONS for boot_loader
;
; written by F. Liebig
;+-->include loader.inc
;v
STACK_SEG equ 01000h
KERNEL_SEG equ 01000h
KERNEL_OFF equ 00200h
LOADER_SEG = KERNEL_SEG
LOADER_OFF equ 00000h
HD0_SEG = KERNEL_SEG
HD0_OFF = 0FFFFh - STACK_SIZE - SECTOR_LEN
HD0_LABELS = 0FFFFh - STACK_SIZE - SECTOR_LEN - 4*16 - 4*8
BUF = 1024 * 32
FONT_SEG = 02000h
FONT_OFF = 00000h
STACK_SIZE = _i8086_minimum_framesize * _numberOF_nested_function_calls
_i8086_minimum_framesize = 8 * WORD_SIZE
_numberOF_nested_function_calls = 0200
WORD_SIZE = 2h
SECTOR_LEN = 512
IO_TRIES = 00Fh
;now the originally loader code follows
;ideal directive only used for borland's turbo assembler
ideal
segment _loader byte public use16
p386
assume cs:_loader, ds:_loader, es:_loader, fs:_loader,gs:_loader
cli
xor ax,ax
dec ax
mov sp,ax
mov ax,STACK_SEG ;have one here on your self
mov ss,ax
; ss:sp is now set for my further use!
mov ax,7c0h
mov ds,ax
mov es,ax
; ds is ready for use only while this startup_code_functios
mov ax,0b800h
mov fs,ax
xor bx,bx
mov cx,80*25
mov ax,203h
@cls0:
mov [fs:bx],ax
inc bx
inc bx
loop @cls0
jmp short @printsth
label _cr0
_copyright_ db '(C)&written by F.Liebig',0
label _cr0e
label fb0
firstmsg db '** FL loader (2+400æ)x10^3 **', 0h
label fb0e
@printsth:
mov dl,7
call near setcol
mov dh,0
mov dl,40- ((_cr0e-_cr0) SHR 1)
call near setpos
mov bx,offset _copyright_
call near printstr
mov dh,12
mov dl,40- ((fb0e-fb0) SHR 1)
call near setpos
mov bx,offset firstmsg
call near printstr
call near getkey
jmp last_but_not_least
label hello_world
db 'hello world! greetings from germany/ns! @8^)',0
label hello_world0
label further_on
db 'further on: were posting around in news://news.comp.lang.asm.x86',0
label further_on0
label quietplease
db 'I would like to make even more outputs but we will halt this system now
!',0
label quietplease0
last_but_not_least:
mov dh,22
mov dl,40-((hello_world0-hello_world) SHR 1 )
call near setpos
mov bx,offset hello_world
call near printstr
call near getkey
mov dh,23
mov dl,40-((further_on0-further_on) SHR 1 )
call near setpos
mov bx,offset further_on
call near printstr
call near getkey
mov dh,24
mov dl,40-((quietplease0-quietplease) SHR 1 )
call near setpos
mov bx,offset quietplease
call near printstr
call near getkey
jmp short shutdown
proc getkey
xor ah,ah
int 16h
retn
endp
proc shutdown
hlt
retn
endp
;PUT IN HERE CODE that you'd like to insert very much
;+-|printc|-----------------------------------------------------------------+
;| dl = ascii - value (character)
;|
;| prints single character on screen and updates cursor
;+--------------------------------------------------------------------------+
proc printc
jmp short @printc_main
TXTSEG equ 0b800h
x db 0
y db 0
clr db 0
@printc_main:
cmp [x],80
jb short @doprint
mov [x],0
inc [y]
cmp [y],25
jb short @doprint
mov [y],0
mov [clr],4
@doprint:
cmp [status],0
jz short @txtstring
mov bh,[y]
mov bl,[x]
mov ah,dl
mov al,10h
int 80h
jmp short @printc_done
@txtstring:
mov ax,TXTSEG
mov fs,ax
mov ax,80
mul [y]
add al,[x]
adc ah,0
shl ax,1
mov bx,ax
@dostring:
mov [fs:bx],dl
mov dl,[clr]
mov [fs:bx+1],dl
@printc_done:
inc [x]
retn
endp
;+-|setcol------------------------------------------------------------------+
;| dl = value
;|
;| set text-mode-attribute (color_bits)
;+--------------------------------------------------------------------------+
proc setcol
mov [clr],dl
retn
endp setcol
;+-|setpos|------------------------------------------+
;| dx: dh=Y pos; dl=X pos
;|
;| set absolute position of text-mode-printings
;+-----------------------------------------------------+
proc setpos
cmp dh,25
jae @setpos_e
cmp dl,80
jae @setpos_e
mov [x],dl
mov [y],dh
@setpos_e:
retn
endp setpos
;+-|printstr|------------------------------------+
;| bx=*string pointer
;|
;| prints null-terminated-string to screen
;+------------------------------------------------+
proc printstr
mov dl,[bx]
or dl,dl
jz short @printstr_end
push bx
call near printc
pop bx
inc bx
jmp short printstr
@printstr_end:
retn
endp
status db 0h
ends
end