Displaying text help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
dozerl
Posts: 19
Joined: Tue May 10, 2005 11:00 pm
Location: here

Displaying text help

Post by dozerl »

Here is the code:

[BITS 32]
global start
start:
mov esp, _sys_stack
jmp stublet

ALIGN 4
mboot:

MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_AOUT_KLUDGE equ 1<<16
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
EXTERN code, bss, end

dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_CHECKSUM

dd mboot
dd code
dd bss
dd end
dd start

stublet:
mov ah, 09h
mov bx, 0B800h
mov es, bx
mov byte [es:0], 'H'
mov byte [es:1], 1fh
int 10h

jmp $



SECTION .bss
resb 8192
_sys_stack:


I compile it using nasm and make it into a flat bin file with ld. When i try to run it under Bochs it gives me this:

00009709271p[BIOS ] >>PANIC<< floppy recal:f07: ctrl not ready
00009710605p[CPU0 ] >>PANIC<< HALT instruction encountered in the BIOS ROM
00009710605p[CPU0 ] >>PANIC<< WARNING: HLT instruction with IF=0!
00242110000p[WGUI ] >>PANIC<< POWER button turned off.
00242110000i[SYS ] Last time is 1118286863
00242110000i[CPU0 ] real mode
00242110000i[CPU0 ] CS.d_b = 16 bit
00242110000i[CPU0 ] SS.d_b = 16 bit
00242110000i[CPU0 ] | EAX=fffff001 EBX=0000ce3d ECX=00140004 EDX=00000000
00242110000i[CPU0 ] | ESP=0000ff72 EBP=0000ff84 ESI=0000733f EDI=00007365
00242110000i[CPU0 ] | IOPL=0 NV UP DI PL NZ NA PO NC
00242110000i[CPU0 ] | SEG selector base limit G D
00242110000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D
00242110000i[CPU0 ] | DS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00242110000i[CPU0 ] | ES:07c0( 0000| 0| 0) 00007c00 0000ffff 0 0
00242110000i[CPU0 ] | FS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00242110000i[CPU0 ] | GS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00242110000i[CPU0 ] | SS:0000( 0000| 0| 0) 00000000 0000ffff 0 0
00242110000i[CPU0 ] | CS:f000( 0000| 0| 0) 000f0000 0000ffff 0 0
00242110000i[CPU0 ] | EIP=00000946 (00000946)
00242110000i[CPU0 ] | CR0=0x00000010 CR1=0x00000000 CR2=0x00000000
00242110000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000

When I run it with out Bochs it just reboots. Could someone please tell me what I am doign wrong here. I have been racking my brain for a while with it. Thanks alot.
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

Re: Displaying text help

Post by digo_rp »

you have to take care of 32bits operands... example for real mode all operand size start with 16Bits, you may use bootloader that start pm and jump to your image... or you can start with [bits 16] do pm etc. then show your message on screen.
try bootf02.zip on www.osdever.net/downloads

Digo_RP :D
dozerl
Posts: 19
Joined: Tue May 10, 2005 11:00 pm
Location: here

Re: Displaying text help

Post by dozerl »

Alrighty, I'll try that. Thanks very much.
Post Reply