Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22080

OSDEV : VGA terminal printing does not work properly

$
0
0

I am trying to learn how to develope an operating system but i run into a strange problem.

Once i write the simplest Hello World Kernel like the following, every thing goes well and after booting my OS there is "Hello Home!" on the Screen.

void kernel_main(void){    const char hh[] = "Hello Home!";    unsigned short* screen = (unsigned short*) 0xb8000;    for(int i=0;hh[i] != '\0';i++){                 screen[i * 2] = hh[i];                      screen[i*2+1]= 0x0F;    }}

But there is no text popping up if i try to display a string with more than approx. 62 Characters like following

void kernel_main(void){    const char hh[] = "Hello Home!Hello Home!Hello Home!Hello Home!Hello Home!Hello Home!Hello Home!Hello Home!Hello Home!Hello Home!";    unsigned short* screen = (unsigned short*) 0xb8000;    for(int i=0;hh[i] != '\0';i++){                 screen[i * 2] = hh[i];                      screen[i*2+1]= 0x0F;    }}

My other Files are like the website Lowleve eu.

boot.s

//(*1).set ALIGN,    1<<0             /* align loaded modules on page boundaries */.set MEMINFO,  1<<1.set MAGIC, 0x1BADB002.set FLAGS,    ALIGN | MEMINFO  /* this is the Multiboot 'flag' field */.set CHECKSUM, -(MAGIC + FLAGS).section multiboot.align 4.long MAGIC.long FLAGS.long CHECKSUM//(*2).section .text.extern kernel_main.global _start_start:    mov $stack_top, %esp    call kernel_main_stop:    cli    hlt    jmp _stop//(*3).section .bss.align 16stack_bottom:.skip 16384 # 16 KiBstack_top:

linker.ld

ENTRY(_start)SECTIONS{    . = 1M;    .text BLOCK(4K) : ALIGN(4K){        *(multiboot)        *(.text)    }    .data BLOCK(4K) : ALIGN(4K){        *(.data)    }    .rodata ALIGN(4096) : {        *(.rodata)    }    .bss BLOCK(4K) : ALIGN(4K){        *(COMMON)        *(.bss)    }}

Do you guys have any helpful idea why it does behave like that. Thank you an sorry for my bad english.


Viewing all articles
Browse latest Browse all 22080

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>