flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Writing a kernel in C

Author
Thread Post new topic Reply to topic
Azh321



Joined: 27 Jan 2005
Posts: 12
Azh321 10 May 2005, 01:34
Well im not too good with asm, I mean I can write a few things in asm for DOS but only simple stuff. I have the bootloader, and it loads up the kernel, though it doesnt do anything. I was wondering if someoen can help me get some of the basic functions coded in asm so that I can code the kernel in C. Such as something to print text and such. (btw, its in protected mode 32bit)
Post 10 May 2005, 01:34
View user's profile Send private message AIM Address Reply with quote
Azh321



Joined: 27 Jan 2005
Posts: 12
Azh321 10 May 2005, 01:38
One of my friends showed me something like this for printing text, but I still dont know how to implement that into a function to be used in C
(this is nasm btw)
Code:
        ORG   0xFF800000

        BITS 32

SEGMENT .data
message db "Message Here",0

SEGMENT .text
start:
        mov     edi, 0xB8000
        mov     esi, message
        mov     ah, 7           ;Text attribute
.again: lodsb
        stosw
        test    al, al
        jnz     .again

        jmp short     
Post 10 May 2005, 01:38
View user's profile Send private message AIM Address Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 10 May 2005, 10:39
http://www.osdever.net/tutorials/brunmar/tutorial_03.php

This shows how to go from boot to c based kernel. If you look at the first tutorial, http://www.osdever.net/tutorials/brunmar/tutorial_02.php?the_id=18, it shows how and what to do to get into protected mode.
Post 10 May 2005, 10:39
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.