Hydrogen OS first public preview release

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen OS first public preview release

Post by f2 »

I hesitate now to rewrite some parts of the system in C. Making an OS in assembler is a good challenge, but I would like to make a port of the system to others architectures (eg x86_64 or ARM). Actually, I'm doing some tests with Nasm and Tiny C Compiler. It is possible that these tests give a new public release.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Hydrogen OS first public preview release

Post by Dex »

Tommy, please do not be put off by portablaty and ASM think about using MACROS with them you can make any lanuage you want
Example turn asm in to basic just by adding a .inc
BasicX86.inc

Code: Select all

macro PRINT String{

        local .Printer
        local .Nextchar
        local .Done
        local .a

        .Printer:
                mov si, .a
                mov ah, 0Eh
                jmp .Nextchar

        .Nextchar:
                lodsb
                or al, al
                jz .Done
                int 10h
                jmp .Nextchar
                jmp .Done

        .a db String,10,13,0

        .Done:
}  

macro SCREEN mode
{
	push ax

	if mode = 0
		mov ah,0h		;SCREEN 0; Default DOS screen mode
		mov al,3h
		int 10h
	else if mode = 13
		mov ah,0h		;SCREEN 13; VGA
		mov al,13h
		int 10h
	end if

	pop ax
}

macro SLEEP
{
	;Output:
	;ah = BIOS scancode of key pressed
	;al = ASCII character of key pressed
	;Could have also used...
	;	mov ah,8h
	;	int 21h
	mov ah,0h
	int 16h
}

macro END
{
	mov ax,4Ch	;\END
	int 21h		;/
}

macro LOCATE row,col
{
	pusha

	mov ah,2		;Function 2
	mov bh,0		;Use page 0
	mov dh,row	;row
	mov dl,col		;col
	int 10h

	popa
}
And then you can do this:

Code: Select all

	SCREEN 0
	LOCATE 5,5
	PRINT "Hello World"
	SLEEP
	END
With fasm you have both a x86 and Arm ver ;).
NOTE: Example is for Dos.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen OS first public preview release

Post by f2 »

Finally, Hydrogen OS is and always will be an OS written in assembler. I have a lot of problems with TCC that I prefer to give up.
FASM is an excellent low-level assembler. With a good set of macros, it is really great.
Yes, there is an ARM port of FASM, and even a version for MIPS processors, located somewhere in the flatassembler forum.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
gravaera
Member
Member
Posts: 737
Joined: Tue Jun 02, 2009 4:35 pm
Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.

Re: Hydrogen OS first public preview release

Post by gravaera »

One solution to portability is to require that no matter what architecture it is to ported to, the compiler should be a cross version of ONE fixed compiler.

In my kernel, as it is so far, it's fully portable (even onto a another (probably embedded) architecture) as long as it's compiled with G++ compiler for that architecture/platform. I DO have a compiler.h setup, but it's really not that flexible. And it's irritating to use. So I end up not really using anything from that compiler.h setup, and therefore end up just having to require that anyone trying to port will have to use a G++ compiler of some sort.
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Hydrogen OS first public preview release

Post by NickJohnson »

gravaera wrote:One solution to portability is to require that no matter what architecture it is to ported to, the compiler should be a cross version of ONE fixed compiler.

In my kernel, as it is so far, it's fully portable (even onto a another (probably embedded) architecture) as long as it's compiled with G++ compiler for that architecture/platform. I DO have a compiler.h setup, but it's really not that flexible. And it's irritating to use. So I end up not really using anything from that compiler.h setup, and therefore end up just having to require that anyone trying to port will have to use a G++ compiler of some sort.
Or simply adhere to the proper standards instead of using special compiler extensions. C++ might be a bit harder because the implementation is so complex, but there should be a simple common subset of features supported by most compilers. And just because something compiles on one arch with a compiler doesn't mean it will work on any other arch with the same compiler. I test my OS on a couple different compilers (mostly gcc and tcc) to make sure everything is proper.

And if you're using assembly, regardless of if the same assembler works for different architectures, you will *always* have to rewrite *all* of your kernel to port it. Dex's BASIC-like method would also require rewriting everything... if you want actual portability you might as well use C/C++ (assuming you want portability... that's not always the goal, and an assembly OS has speed and coolness points).
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Hydrogen OS first public preview release

Post by Dex »

NickJohnson wrote:Dex's BASIC-like method would also require rewriting everything... if you want actual portability you might as well use C/C++ (assuming you want portability... that's not always the goal, and an assembly OS has speed and coolness points).
Yes there will always be the need to do some rewriting, but this is not always a bad thing, to mod the underlining design to take addvantage of the processor .
The basic like method is more usefull for writing the apps in, but if you keep your kernel design KISS, its much easier to port, eg: my OS is abased on KISS and can run on both x86 and arm.

@Tommy, I like the clock in your demo, would it be possable to post the colors used for the background, digets and shadow, of the clock, as you got the look just right, thinks.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen OS first public preview release

Post by f2 »

Dex wrote: Yes there will always be the need to do some rewriting, but this is not always a bad thing, to mod the underlining design to take addvantage of the processor .
The basic like method is more usefull for writing the apps in, but if you keep your kernel design KISS, its much easier to port, eg: my OS is abased on KISS and can run on both x86 and arm.
What is KISS?
Dex wrote:@Tommy, I like the clock in your demo, would it be possable to post the colors used for the background, digets and shadow, of the clock, as you got the look just right, thinks.
background = 88976Eh
digits = 394030h
digits shadow = 68774Eh
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Hydrogen OS first public preview release

Post by Dex »

Thanks for the colors.
Here tells what KISS is about http://en.wikipedia.org/wiki/KISS_principle
We (team DexOS) use it, as "Keep It Small and Simple"
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen OS first public preview release

Post by f2 »

Dex wrote: Here tells what KISS is about http://en.wikipedia.org/wiki/KISS_principle
We (team DexOS) use it, as "Keep It Small and Simple"
OK.

I hesitate to rewrite my OS in FASM, respecting the KISS model. Sol_Asm is a good assembler, but it is far from
complete, and as the sources are closed, contributions are impossible.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: Hydrogen OS first public preview release

Post by Craze Frog »

With 32 mb of memory the OS will not boot because it needs "a minimum of 32 mb of memory". It has that, so it shouldn't complain.

And also your mouse driver is broken. The mouse doesn't move in VMware.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen OS first public preview release

Post by f2 »

Craze Frog wrote:With 32 mb of memory the OS will not boot because it needs "a minimum of 32 mb of memory".
This is a weird bug which does not occur in other emulators.
NickJohnson wrote:Some people start at the GUI and work down, while others start with threading and IPC and work up. If you had both, I would be seriously impressed.
Rewriting has not been beneficial for the OS. Bugs have been fixed, others have emerged. I think it would be wise to take
the development from the beggining. Hydrogen OS project is now suspended. I have an old project of a 32-bit multitasking
DOS (called SDOS for "Small Disk Operating System" written in FASM, somewhere on a USB key. I think I will resume the
development of this project. The GUI that I wrote could be a simple SDOS application.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: Hydrogen OS first public preview release

Post by NickJohnson »

Craze Frog wrote:With 32 mb of memory the OS will not boot because it needs "a minimum of 32 mb of memory". It has that, so it shouldn't complain.
Emulators (and real machines) rarely have/report the amount of memory you think you gave them. A 32MB stick of RAM could only be 31MB, or even less. Emulators also sometimes shave off a few KB/MB, for no real reason (afaik...). It would be wise to set the memory requirement to a small amount less than a power of 2, not just a power of two. It's not as bad as hard drives though :mrgreen: .
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen OS first public preview release

Post by f2 »

NickJohnson wrote:
Craze Frog wrote:With 32 mb of memory the OS will not boot because it needs "a minimum of 32 mb of memory". It has that, so it shouldn't complain.
Emulators also sometimes shave off a few KB/MB, for no real reason (afaik...).
It is precisely the problem!

However, I decided to redevelop my old DOS project. SDOS is small (64 KB only) and requires only 256KB of conventional memory.
At least there will be no problem ;) !
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
Coty
Member
Member
Posts: 286
Joined: Thu Feb 12, 2009 5:12 pm

Re: Hydrogen OS first public preview release

Post by Coty »

Dang I missed it :( oh well, it looks cool.
My hero, is Mel.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Hydrogen OS first public preview release

Post by Combuster »

Even real BIOSes steal parts of the memory, at the top for (acpi) local storage, and the 384k from A0000-FFFFF, neither of which you can use.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply