Hydrogen OS first public preview release
Re: Hydrogen OS first public preview release
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
Re: Hydrogen OS first public preview release
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
And then you can do this:
With fasm you have both a x86 and Arm ver .
NOTE: Example is for Dos.
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
}
Code: Select all
SCREEN 0
LOCATE 5,5
PRINT "Hello World"
SLEEP
END
NOTE: Example is for Dos.
Re: Hydrogen OS first public preview release
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.
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
- gravaera
- 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
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.
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.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Hydrogen OS first public preview release
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.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.
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).
Re: Hydrogen OS first public preview release
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 .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).
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.
Re: Hydrogen OS first public preview release
What is KISS?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.
background = 88976EhDex 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.
digits = 394030h
digits shadow = 68774Eh
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
Re: Hydrogen OS first public preview release
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"
Here tells what KISS is about http://en.wikipedia.org/wiki/KISS_principle
We (team DexOS) use it, as "Keep It Small and Simple"
Re: Hydrogen OS first public preview release
OK.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"
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
-
- Member
- Posts: 368
- Joined: Sun Sep 23, 2007 4:52 am
Re: Hydrogen OS first public preview release
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.
And also your mouse driver is broken. The mouse doesn't move in VMware.
Re: Hydrogen OS first public preview release
This is a weird bug which does not occur in other emulators.Craze Frog wrote:With 32 mb of memory the OS will not boot because it needs "a minimum of 32 mb of memory".
Rewriting has not been beneficial for the OS. Bugs have been fixed, others have emerged. I think it would be wise to takeNickJohnson 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.
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
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Hydrogen OS first public preview release
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 .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.
Re: Hydrogen OS first public preview release
It is precisely the problem!NickJohnson wrote:Emulators also sometimes shave off a few KB/MB, for no real reason (afaik...).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.
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
Re: Hydrogen OS first public preview release
Dang I missed it oh well, it looks cool.
My hero, is Mel.
- Combuster
- 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
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.