Building simple os

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
machka
Posts: 9
Joined: Sun Mar 28, 2010 7:50 am

Building simple os

Post by machka »

hi all,
i am new at os development. so i want to go further more. i have boot code that prints simple text to display. so i want to add some bios call to my boot code such as e820 bios call. i want print memory informations to screen. i write my code below. so i put 0xe8 to ah and 20 to al then i call int 0x15 but compiler gives errors. does anyone can help me to correct it. or does some one has the simple code to investigate problem..

regards
machka

Code: Select all

		.text
		.globl	start
		.code16
		
start:
		jmpl	$0x0,	$code
msg:
		.string	"Test\x0"

code:
		movw	$0xb800,%ax
		movw	%ax,	%es
		xorw	%ax,	%ax
		movw	%ax,	%ds

		movw	$msg,	%si
		xorw	%di,	%di
		

		
		cld
		movb	$0x07,	%al
1:
		cmp	$0,	(%si)
		je	1f	
		movsb
		stosb
		jmp	1b
1:		jmp	1b
		
.org	0x1fe, 0x90
.word	0xaa55
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Building simple os

Post by thepowersgang »

Required Reading, you failed it.

1. Use Code Tags
It looks terrible if you paste any sort of code without using the code tag, do us all a favor. (It seems an admin did it for you, lucky everyone else)

2. From the link above, "3: Please try to meet the intellectual requirements"
KNOW YOUR COMPILER! Don't come crying to the forums for each error you get, read the error messages and understand what they are saying, if it still stumps you, read the manuals and if all that fails, then ask.

3. See that link in the top - center of this page? "The OSDev.org Wiki - Got a question? Search this first", that one. Try clicking on it. It will do you a world of good. If you can't understand what's written in there, then you should search the web until you do.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply