flat assembler
Message board for the users of flat assembler.

flat assembler > OS Construction > what is my problem?

Author
Thread Post new topic Reply to topic
urielka



Joined: 16 Nov 2003
Posts: 17
Location: israel
i used the lowos boot (to the aouthor if you want that i stop use it say it to me)
code:

org 0x7C00 ; Unsere Startadresse

; -----------------------------------------
; Unser Bootloader
; -----------------------------------------

start:
; Erst brauchen wir einen Stack.
cli ; Keine Interrupts!
mov ax, 0x9000 ; Stackadresse
mov ss, ax ; SS = 9000 (unser Stack)
mov sp, 0 ; SP = 0000 (der Stackpointer)
sti ; Interrupts zulassen

; Bootlaufwerk aus DL speichern
mov [bootdrv], dl

;Lade unseren Kernel
call load

;Springe zu diesem Kernel
mov ax, 0x1000 ; Die Adresse des Programms
mov es, ax ; Segmentregister updaten
mov ds, ax
push ax
mov ax, 0
push ax
retf

; ----------------------------------------------
; Funktionen und Variablen
; ----------------------------------------------

bootdrv db 0 ;Das Bootlaufwerk
loadmsg db "Loading...",13,10,0

; Einen String ausgeben:
putstr:
lodsb ; Byte laden
or al,al
jz short putstrd ; 0-Byte? -> Ende!

mov ah,0x0E ; Funktion 0x0E
mov bx,0x0007 ; Attribut-Byte (wird nicht benötigt)
int 0x10 ; schreiben
jmp putstr ; Nächstes Byte
putstrd:
retn

; Lade den Kernel vom Bootlaufwerk
load:

; Diskdrive reset (Interrupt 13h, 0)
push ds ; Sichere DS
mov ax, 0 ; Die gewünschte Funktion (reset)
mov dl, [bootdrv] ; Dieses Laufwerk ist gewünscht
int 13h ; Den Interrupt ausführen
pop ds ; DS wiederherstellen
jc load ; Geht nicht? -> Noch mal!

load1:
mov ax,0x1000 ; ES:BX = 10000
mov es,ax
mov bx, 0

; Sektoren lesen (Interrupt 13h, 2)
mov ah, 2 ; Funktion 2 (Lesen)
mov al, 5 ; Lese 5 Sektoren
mov cx, 2 ; Cylinder=0, Sector=2
mov dx, 0 ; Head=0, Laufwerk=0
int 13h ; ES:BX = Daten vom Laufwerk
jc load1 ; Fehler? Noch mal!
mov si,loadmsg
call putstr ; Meldung ausgeben
retn

times 512-($-$$)-2 db 0 ; Dateilänge: 512 Bytes
dw 0AA55h ; Bootsignatur

and write my own kernel
code:

;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;functions
;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
outputscr:
odsb
or al,al
jz short ends
mov ah,0x0E
mov bx,0x0007
int 0x10
jmp outputscr
ends:
retn
inputkb:
mov ah, 0
int 016h
ret
;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;procedures
;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ver:
mov si,msg1
call outputscr
ret
;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
main
;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
mov ax,1000h
mov ds,ax
mov es,ax
start:
mov si,msg
call outputscr
call inputkb
cmp ah,35h
jz ver
jmp start

;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;strings and vars
;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
msg db "press y to get the ver",13,10,0
msg1 db "woody os ver 0.01a",13,10,0
times 32768-($-$$)-2 db 0
Post 10 Jun 2004, 20:19
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
urielka



Joined: 16 Nov 2003
Posts: 17
Location: israel
i found my problem in outputscr function it`s lodsb and not odsb
Post 10 Jun 2004, 20:39
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
urielka



Joined: 16 Nov 2003
Posts: 17
Location: israel
i finshed my os named woody os becuase i build a pentium 2 on a wood case with my friend and tell him "this strange pc a strange pc need a special os" so i build woodyos(wos) it only can output a string and if you press w it will show you the ver(ver is wos 0.0a)
every want does want to say something
i know that it`s not an os but it`s a basic i/o for an os


Description: woody os ver 0.01a
Download
Filename: wos.rar
Filesize: 334 Bytes
Downloaded: 223 Time(s)

Post 10 Jun 2004, 20:47
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.