flat assembler
Message board for the users of flat assembler.

Index > OS Construction > My questions about getting started...

Author
Thread Post new topic Reply to topic
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
Hey! I am working on a small text based OS and I am VERY confused. I haven't learned all of FASM yet and I am having trouble figuring out where to start...

Okay, I started over so I have new code and questions... so I edited this topic. Very Happy

Okay, I want to show text while the kernel is loading... I tried putting it at the top but it makes so extremely wacky stuff happen on my computer (happy faces dancing around... black and orange spades scrolling on the screen, etc).

I want to stay in 16 bit mode, so don't ask me why I didn't enable the a20 gate and tell me that I should and all of that.

My next question is, I want to make my text colored... but only certian pieces of text... I don't want a whole like to be one color (but then it should be able to do that if I want it to)

Also, how do I check for a keyboard and show at the top (with the loading code) wether it is detected or not? (EX: Loading... Keyboard Detected!)

I may have more questions in the future...

Thanks!

P.S. Here is the code:

Code:
org 0x7C00 

use16
;****************************
; Realmode startup code.
;****************************

start:
        xor   ax,ax
        mov   ds,ax
        mov   es,ax
        mov   ss,ax
        mov   sp,0x7C00 

        push 0x0700
        push hellomsg
        call putstr

        putstr: ; bp+4 = string, bp+6 = attr
                push bp
                mov bp, sp
                push si          ; save si

                mov si, [bp+4]   ; pointer to the string
                mov ax, [bp+6]   ; ah = attr
        .prt: lodsb            ; al=str[i]
                or al, al        ; if(al==0)
                jz .ret          ;   return
                push ax          ; put char
                call putch       ;
                add sp, 2        ;
        jmp .prt         ; repeat

        .ret: pop si           ; restore si
                mov sp, bp
                pop bp
        ret 

        putch: ; [bp+4]:high = attr, [bp+4]:low = char
                push bp
                mov bp, sp

                mov dx, [bp+4]
                mov ah, 0x0E    ; put char
                mov al, dl      ; al = char
                mov bh, 0x00    ;
                mov bl, dh      ; bl = attribute
                int 0x10        ;

                mov sp, bp
                pop bp
        ret

        hellomsg db 'Hello!'    


Last edited by DataHunter2009 on 15 Jun 2005, 18:52; edited 2 times in total
Post 14 Jun 2005, 17:24
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Why do you not use http://alexfru.chat.ru/epm.html#los4d
or http://alexfru.chat.ru/epm.html#bootprog
Is not life hard enough with out making it harder Wink
Post 14 Jun 2005, 18:14
View user's profile Send private message Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
No thanks. Im more familiar with GRUB. But if I could find a good working boot loader for FASM, then i'd use it, but everything I have tried hasn't worked. I know GRUB is complex and bulky (i don't like the idea of the built in command prompt stuff... i'd like to make my own), but I can't find any other solution.
Post 14 Jun 2005, 18:37
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Try this for simplicity go to "Dex4u" web site http://falconrybells.co.uk/
and get "Dex.zip" in the zip is a file called "KERNEL32.EXE" put a empty floppy disk in the a: drive and click on "KERNEL32.EXE" this will put the boot sector on the floppy along with a file called "kernel32.exe" you if you want, try "Dex4u" by rebooting with the floppy in and try some of the programs it runs.
Any way when you have finish you can delete all the files on the floppy (but do not format it) now if you write you kernel as a mz exe and call it "kernel32.exe" and put it on the disk from windows and boot it, it will boot your OS Cool .
Post 15 Jun 2005, 01:37
View user's profile Send private message Reply with quote
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
I am using a heavily modified version of you CdPod OS. I like that it loads everything from the kernel... so now back to the questions. Very Happy
Post 15 Jun 2005, 18:28
View user's profile Send private message 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.