Page 1 of 1

question about a HAL

Posted: Thu Apr 12, 2007 7:58 am
by bsunisol
hi,
i startet to began coding a simple osloader.
but without a concept at all. so i began to read and look for tutorials and documents. now i see that have to do a HAL first.
but i think a HAL with just in() out() disable_int() enable_int() is not really usable....

what would (or have) you put in your HAL,
or did you realise that with a complete different concept?

thanks
Uni_Sol

Posted: Thu Apr 12, 2007 6:56 pm
by mystran
Personally I'm so portable I don't have a HAL. ;)

Posted: Thu Apr 12, 2007 7:06 pm
by hendric
If you want port your kernel to other platform , a HAL is necessary. For my design , I do not want my kernel porting from x86 to other platform so my HAL is simply implement pio / interrupt et.al. for convient usage. Whether to have a HAL or not depends on your purpose about portability , it's up to you

Posted: Thu Apr 12, 2007 7:18 pm
by hendric
And As my opinion , I do not think portability is necessary because I do not have to. I prefer deeply traiting features of a explicit platform such as x86. Like windows , to implement a top OS on a explicit platform is considered as a good idea, I think.

Posted: Thu Apr 12, 2007 7:29 pm
by Alboin
I'm currently writing a HAL like layer for my OS entirely in assembly as it doesn't have to be portable. However, it is a very thin layer. For example, I have put_char written in assembly, but put_string, put_int, and printf, are all in C. I'm thinking that if it's written in C, then it is completely portable. Moreover, writing it in assembly makes it faster than C. :wink:

Posted: Thu Apr 19, 2007 2:53 am
by hendric
Alboin wrote:I'm currently writing a HAL like layer for my OS entirely in assembly as it doesn't have to be portable. However, it is a very thin layer. For example, I have put_char written in assembly, but put_string, put_int, and printf, are all in C. I'm thinking that if it's written in C, then it is completely portable. Moreover, writing it in assembly makes it faster than C. :wink:
Yea that's the same thing I did. In my design , I do not have an explicit HAL but a group of abstract of hardware functions such as "set interrupt entry", " Spin Lock" , "IO Port" et.al
I think it enough, and also do I think x86 is enough (with multi-cored :twisted: ) . For other platform I prefer designing a new Operating System model to expose potention of the very architecture .
The same to x86-64 architecture , I do not believe it can be mainstream in future.