Register  FAQ   Search   Memberlist   Usergroups    fChat    Profile   Log in to check your private messages   Log in
Having problems with my os

 
Post new topic   Reply to topic    DexOS Community Forum Index » OS Dev & Hobbies View previous topic :: View next topic  

Having problems with my os
 PostPosted: Wed Oct 07, 2009 5:00 pm Reply with quote  
Message
  gluon

Joined: 16 Dec 2008
Posts: 167
Location: Bucharest, Romania

Hello! I'm finally working on my own kernel and as i don't know FAT12 i can't execute progs. So i thought of making a small program wich reads opcodes 'till enter is presed and then it executes that program. But it does not work at all... could you help me please?
Nasm code
Code:

[BITS 16]
[ORG 0x7C00]
mov ah,0eh
mov al,'>'
int 10h
jmp next
next:
mov ah,00h
int 16h
mov ah,0Eh
int 10h
cmp al,13h
je finish
cmp al,64
jb nr
ja lit
nr:
inc bx
sub al,48h
mov [msg+bx],al
mov al,0h
jmp next
lit:
inc bx
sub al,55h
mov [msg+bx],al
mov al,0h
jmp next
finish:
mov ax,03h
int 10h
msg db 0
times 510-($-$$) db 0
dw 0xAA55

_________________
Software is pretty much like cathedrals: first we build them, then we pray.


View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

 PostPosted: Thu Oct 08, 2009 2:16 am Reply with quote  
Message
  Steve

Joined: 06 Mar 2008
Posts: 163
Location: USA

interesting program. The program bootprog at:
http://alexfru.chat.ru/eindex.html
does what you are trying to do, except the name is stored in the file and not keyed in. There is also:
http://www.emu8086.com/dr/asm2html/assembler_source_code/zip/emu8086_tutorial_make_your_own_micro-os.zip
Then there is minidos, Dex's project:
http://www.dex4u.com/MiniDos/Fasm4MiniDos.zip
All are reasonable short examples that are close to what you want
_________________
Sadly DexOS is incomplete, it has no blue screen of death. Hummmm guess it's up to me to add one Smile


View user's profile Send private message Visit poster's website

 PostPosted: Thu Oct 08, 2009 3:42 am Reply with quote  
Message
  lone_wolf

Joined: 09 Jan 2009
Posts: 83

I know your using Nasm but
One thing nice about fasm...

is this:
Code:

source0:   file 'somehtmldoc.html'
source1: file 'text.txt'
source2: file 'image.bmp'
source3: file 'test.bin'


[edit] for space//


Last edited by lone_wolf on Thu Oct 08, 2009 1:01 pm; edited 1 time in total


View user's profile Send private message

 PostPosted: Thu Oct 08, 2009 11:43 am Reply with quote  
Message
  gluon

Joined: 16 Dec 2008
Posts: 167
Location: Bucharest, Romania

so can i say:
========
mov source1,filename
source: file 0
========
i don't rally junderstand the floppy thigny....
_________________
Software is pretty much like cathedrals: first we build them, then we pray.


View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

 PostPosted: Thu Oct 08, 2009 11:46 am Reply with quote  
Message
  lone_wolf

Joined: 09 Jan 2009
Posts: 83

later today I will post you a small demo.. to test with.. Very Happy


View user's profile Send private message

 PostPosted: Thu Oct 08, 2009 1:00 pm Reply with quote  
Message
  lone_wolf

Joined: 09 Jan 2009
Posts: 83

Compile with Fasm and load on a floppy..
tested with qemu or real os.. I used rawrite to put on a floppy..
and boot! The test.txt must be in the dir that your boot.asm is..


save as:

test.txt
Code:

Hello this is a test. From our test
 file to see if we can read it!


Fasm boot.asm boot.bin
Code:

  org 0x0600
     use16

start:
     
      xor   ax,ax
      mov   ds,ax
      mov   es,ax
      mov   ss,ax
      mov   sp,0x7c00
      sti
      cld
      mov si,sp
      mov di,0600h
      mov cx,438
      rep movsw
     
      jmp 0000:main
   
main:
     mov ah,02
     mov bh,0
     mov dx,0
     int 10h
     mov ah,9
     mov cx,2000
     mov bl,1Fh
     mov al,' '
     int 10h
       
     mov si,welcome
     call print
     
     mov si,source1
     call print
   
   
   jmp $
   
welcome: db "Demo for reading files without a disk!",13,10,0

print:
      mov   ah,0Eh                       ; Request display
again1:
     lodsb                              ; load a byte into AL from DS:SI
      or   al,al                         ; Or AL
      jz   done1                         ; Jump 0, to label done1
     int  10h                           ; Call interrupt service
      jmp  again1                        ; Jump to label again1
done1:
     ret                                 

source1: file 'test.txt'

times 510 - ($-start) db 0 
dw 0xaa55 


View user's profile Send private message

 PostPosted: Thu Oct 08, 2009 5:36 pm Reply with quote  
Message
  gluon

Joined: 16 Dec 2008
Posts: 167
Location: Bucharest, Romania

oh.. so the file's data is inserted into the program, not loaded when it's started.
PS: Why didn't you typed org 7c00h instead of 600h?
_________________
Software is pretty much like cathedrals: first we build them, then we pray.


View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Post new topic   Reply to topic    DexOS Community Forum Index » OS Dev & Hobbies

Page 1 of 1
All times are GMT

Display posts from previous:

  

Jump to:  
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