Sunday, December 31, 2006

يوم العيد

دايما بيبقى في حاجه مختلفه يوم العيد. معرفش حد غيري بيلاحظ الكلام ده و لا لأ.
مهما كان الجو مهبب فبل و بعد يوم العيد, دايما تلاقي بوم العيد شمسه طالعه و جوه معدول.
و كمان دايما بتلاحظ ان كل الحاجات اللي حواليك مشرقه و كانها فرحانه. دي مش اول مره الاحظ الكلام ده, دانا بقالي اكتر من 4 سنين بلاحظ كده.
و كمان ايه. بتلاقي الحاجات متسهله كده يوم العيد. بعتي مثلا لو عندك
error
تلاقي ربنا فتحها عليك كده و اتحل.
سبحان الله فعلا.
عارفين بقى اكتر حاجه بحبها في العيد ايه؟ اني بلاقي الناس كلها فرحانه و مطرح متبص تلاقي ابتسامات؛ حاجه كده على غير العاده. انا بحسد اليابانيين علي انهم مبتسمين دايما طول السنه. نفسي نبقى زيهم و خصوصا ان البسمه في وجه اخيك صدقه.
اما اكتر حاجه بتغيظني ان في راجل مستفز مصر يقول "الله اكبر الله اكبر ولله الحمد" في الميكروفون لوحده و يلغوش على صوت الناس. اصل انا بالنسبالي افضل اسمع صوت الناس بس و افرح لما الاقيه مسمع, مش صوت مكروفون لما يقف تلاقي الناس ولا كأنها بتكبر في سرها. حلمي: اسمع مصر كلها و هيا بتكير كده من غير ميكروفون؛ زي الحج كده.
معلش كان نفسي ال
post
تكبر عن كده لكن انا مش متعود اكتب عربي. :)


Saturday, December 30, 2006














[Click to enlarge]
This is the most recent Screenshot on Bochs.
It shows in the first 8 lines, the GRUB output. After that the components status. Also A gray line to indicate that the lines before it was before paging, and lines after it was after paging. Then a test of the panic() kernel function :D.

ArOS, what to do now ?

Well,
http://www.osdev.org/osfaq2/index.php/HigherHalfKernel
http://www.osdev.org/osfaq2/index.php/HigherHalfBareBones
http://www.osdev.org/osfaq2/index.php/BareBonesC%2B%2B

I should before implementing the memory manager (just bare kernel allocators for now), to move to the higher half memory, and to enable C++.
I have to move to the higher half now because doing so later will be harder. Also I really have to enable C++ so I'd write a decent infrastructure of the HAL (H/W Abstraction Layer) below the memory manager, so It becomes much easier to develop and maintain the memory manager. Or if it is not a full HAL, it just can encapsulate the annoying-to-handle bit-fields of the flags in the Page Table Entries of the Page Table.
What I should do exactly now isA is to read those links and see how I can integrate them into my code. The integration would destroy half of my code since it requires paging to be enabled from the very start; which I don't do. I still don't get what the status of the GDT if the paging was applied so early, I know it still have to be there, because at least of the IDT, if it wasn't for Call Gates or TSS.
About the C++ thing, I am thinking of integrating libgcc/libsupc++. (see http://www.osdev.org/osfaq2/index.php/Doing%20a%20kernel%20in%20C%2B%2B section: Full-runtime support). It is because I want to enable Full-runtime support so I don't have to worry about it later.
It's some painful tasks to do, but we've gotta do them sometime :(. I hope I get them done some time soon, because they are just standing in my throat and I am almost choking :S.

Wednesday, December 27, 2006

Allocators' World Party!

In this link http://www.cs.rochester.edu/u/scott/252/assignments/A7.shtml, an interesting assignment. In short, you should do you allocator. malloc/free is an allocator. You should do you own version. Say, my_malloc/my_free. The interesting part that in our faculty, we didn't hear about the word "allocator" in the first place, how about making one! Also notice how well-defined the requirements are. Correctness/Performance/Style has well-defined points per each. In our faculty, and I assume in most FCIs in Egypt, the requirements are according to the doctors mood, i.e. not well-defined, ambigious, or undefined at all. Also there is no clear point-per-requirement mapping, in best cases, it is clear only in the evaluator's head, i.e. students have no idea about them. Also there is no reserved points for bonus; like Performance. The style part has no attention at all. Baseline, get me one student in Egypt who can make that assignment and take at least half the points (success ratio). Also note that in such an assignment(project ?) there is support routines, a library, or a framework to help students do the part that matters, not donkey-work's parts, irrelavent parts, nor time-wasting parts, i.e. goal of such project is well-defined and should not be distracted. Also, the person who set the project have an idea how it can be made in the first place ;) which is not always the case here!
Can anyone who went to Egyptian FCI (not even a student) do this assignment ? I am sure there is but they will be very few, it is a shame that such an assingment is very popular in such courses and we didn't even hear the terminology!

Monday, December 25, 2006

How to never lose ?

What's a loser ? And what's a winner ?
Traditional answer :
A loser is a person who lost something; a game, a compitition, someone etc. A winner is the one who won what a loser lost.
A loser looks down to himself in most cases, feels angry and thinks he must win in another time to have a value.
No one wants to be a loser.
But, look at it from another angle.
You lost, so you learned there is something you did that was wrong, then you learned a new thing, then you've won something that the other winner didn't win. Strange viewpoint, and I am almost sure it didn't convince you.
Ok, let's change the viewpoint even more. If you lost something, then you have less ways of losing it again! :D. Clarifying that, let's say that there is n ways you could lose a runnig race, you don't know all of them yet, so you aren't prepared for each one. So one of these ways have made you lose. The next time you know that way, so you are prepared for it, so you now have n-1 ways of losing ;). One after another, you'll eventually have zero ways of losing.
The inventor of the electrical light bulb, Thomas Addison, who performedthousands of experiments until achieving the desired result. "Who here has made that many attempts to succeed in something? Do we try more than two or three times before we give up?", "there is no such thing as 'I can't do it', there is 'I can't do it yet, and I have to keep trying'".

So personally I see each failure as a step towards success. Perhaps programming have tought me so, fixing an error after anothet till the compiler is shy from saying another error cuz keda 7aykoon beystahbel :D.
A real loser is the one who don't learn from his failures. And a real winner is the one who keeps learning till he reaches. A real loser is the person who stops trying. And a real winner is the person who never stops.
One last word, A real winner of winners, is the person who is not satisfied with the desired result after he achieves it and keeps trying to improve it further and further till he makes the best result in the history and possibly for several centuries to come. That is a real scientist mind.

So, people who read this post, if you have failed in something, don't get stuck at that and keep crying about it forever, get over it and just try another way. It is the same concept as lighting a little candle is better than damning the darkness thousand times. Don't be just optimistic, believe in your capability to do it and foresee the expected ways of failure to decrease the times you have to try.

A side note, there is a group (osra) in our college, that had failed many times, but personally, I never gave up on it; believing that as we keep trying we sure will reach isA. Even if we just reached experience of how to avoid such failures again, that would be enough. But what did I say above ? If you actually reached that, there is nothing called 'enough'.

keep in mind
ان الله لا يضيع أجر من أحسن عملا
و لا تنسوا التوكل على الله
و لا تنسوا حمد لله علي كل حاجه عشان اللي بيحيبوا ربنا هوا اللي فيه الخير بعد ما تكون طبعا عملت اللي عليك

Friday, December 22, 2006

Java :(

In our Java project, I had some frustrating errors that I can't figure out till now.
The project is video streaming and I am using JMF.

I tried to send frame by frame at first. The client only displayed the first frame and stopped althought the server is showing the video correctly. I discovered after five days of tracing and testing the BufferedImage and ObjectStream and BufferToImage, that the problem was solved when I reallocated the byte array every time instead of reusing it!

Another one, using the RTPManager of JMF, both the server and the client was on the same machine, the program never worked when using 127.0.0.1, I had to use the actual IP of my machine (I wonder what if I was disconnect and don't have an IP ?)

Today I had a strange error too, I still didn't trace it. I initialize ActionEvent(this,0,"GotPlayer"), I get an exception telling me the the source (this) is null. I tried to ActionEvent(new Object(),0,"GotPlayer"), I got the same error too!

Please somebody have an answer tell me, I really got tired of that.

Ah, by the way, sometime we got an error in our MFC project, a line that assigns a function to a function pointer, we traced it, the funtion pointer is still = null after the assignment although the watch of the function itself (the right hand side of the assignment) was not null.

Either, the evil forces of darkness has conspired upon us, or this is really some programming myths that should be reserved for history cuz maybe after 1000 years the sercret will be unvield!