View Single Post
Old Oct 20th, 2006, 2:05 PM   #5
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
Yeah I realized that the jmp was branching me somewhere it wasn't supposed to, but removing that instruction as in the reply before yours, and messing with those registers as niteice suggested didn't work either. For some reason the code produces the correct output on one emulator. However, when I try to put it in the bootsector of a floppy image and boot it in Bochs no output is produced. With a modification of other code It does work and I honestly can't tell why. This is the modified code from the bootstrapper of MenuetOS and I just stripped it down so that it would only display MenuetOS on the screen.
boot_program       equ 07c00h ;position for boot code
   
                   jmp start_program
                   nop
   



start_program:

  xor ax,ax
  mov ss,ax
  mov sp,boot_program
  push ss
  pop ds

  mov  si,loading+boot_program
loop_loading:
  lodsb
  or al,al
  jz procura_arquivo_novamente
  mov ah,0eh
  mov bx,07h
  int 010h
  jmp loop_loading


procura_arquivo_novamente:

  push ss
  pop es

  mov  bp,16

newtry:

  dec bp

loop_envio_mensagem:

  lodsb
  or al,al
  jz espera_digitar_tecla
  mov ah,0eh
  mov bx,07h
  int 010h
  jmp loop_envio_mensagem

espera_digitar_tecla:

  jmp $

loading   db 13,10,'Starting MenuetOS ',00h


times 0x1fe-$ db 00h

  db 55h,0aah ;boot signature
I fail to understand why this works and my simpler code doesn't.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote