hannah wrote:
andrewthompson555 wrote:
Maybe you should look at the first post.
1) Stop using real mode.
2) Use C. ASM is ridiculous for your knowledge.
Answer my question. Assembly is what I've learned before C and Java. I've learned many interrupts. I know some C. As a matter of fact, C is much more harder. It is more portable.
Here's a kernel from the internet:
/*
* kernel.c
*/
void kmain(void)
{
const char *str = "my first kernel";
char *vidptr = (char*)0xb8000; //video mem begins here.
unsigned int i = 0;
unsigned int j = 0;
/* this loops clears the screen
* there are 25 lines each of 80 columns; each element takes 2 bytes */
while(j < 80 * 25 * 2) {
/* blank character */
vidptr[j] = ' ';
/* attribute-byte - light grey on black screen */
vidptr[j+1] = 0x07;
j = j + 2;
}
j = 0;
/* this loop writes the string to video memory */
while(str[j] != '\0') {
/* the character's ascii */
vidptr[i] = str[j];
/* attribute-byte: give character black bg and light grey fg */
vidptr[i+1] = 0x07;
++j;
i = i + 2;
}
return;
}
Here's a bootloader for Assembly I've wrote myself:
BITS 16
org 0x7C00
jmp Start
Print:
lodsb
cmp al, 0
je Done
mov ah, 0eh
int 10h
jmp Print
Done:
ret
Start:
mov si, msg
call Print
msg db 'Hello World!", 0
times 510-($-$$) db 0
dw 0xAA55
Do you see any difference? }; and { and (i =0 3910 =29i49t9u8ehbay8gfuo is an example of C. I don't need C! KolibriOS and Baremetal OS were done 100% fully in Assembly.