Wednesday, May 31, 2006

20!

Twenty factorial?


Thank God for all the blessings especially the gift of life. Thank you mom and dad for taking care of me. Thank you everyone! Happy birthday to me! I am no longer a teenage lad. I could not believe it. Time flies so fast.

Saturday, May 27, 2006

Revamp, an apology

[Previous Post]
Sorry I forgot the private flag because I was in a hurry awhile ago. I hope it didn’t deface Planet Ubuntu-PH.


[OS Development]
Global Descriptor Table conquered! Nothing special, more tasks ahead. So far so good. Linux 0.01 is cool and MiniOS (Minix) too! Hail to you Linus Torvalds and Andrew Tanenbaum.

Jeepney, today - 2

Thinking of the song? No, definitely not Kala’s hit in the Myx Daily Top 10.


It was 31 down 7 o’clock in the evening, the last day of our training. The sky was darkening and the wind blew softly as I walked toward the terminal. Going home later than 6 o’clock in the evening is such a waste of time I heard myself whisper. Before taking the jeepney in line, I have decided to sit down and buy a bottle of coke in a bakery situated near the end of the terminal. While taking a sip, I observed people passing by. Definitely not Manila, whispering to myself and reminiscing the events a year ago. 5 minutes would be long enough for me to begin sipping air so I took a jeepney. I have waited for the jeepney to be filled up. Not exceeding 10 minutes, the wheels started rolling as expected.


This year is going to be the hardest school year ever. Again, talking to myself. Anticipating sleepless nights, hardworks, additional duties or obligations, etc. Then suddenly while thinking of these, my sight landed on the driver. He looked so tired and problematic. What if I am on his shoes? Is he happy with his life? Then I began asking myself, what would be my life a year after wherein I will not be calling myself a student anymore? Will I be able to work in prestigious firms such as NEC, Orange and Bronze, Accenture, etc.? Well, so much for that.


It was time to pay for my fare and step down.


Please hand my fare over, I handed PhP 6.00 (discounted fare for students and senior citizens). Not far from the jeepney, I was wondering why it was not moving and all the passengers were looking at me. It seems that there was a problem. I approached the driver with an idea that he wasn’t happy with my fare. He shouted, how much do you pay to this far?! I replied, PhP 6.00, student. Student?! it’s summer break, no classes these days! My reply, I have summer classes and it does not mean that if it’s summer break then we should follow regular fare. The reasons why students and senior citizens follow the discounted fare are,


[Students]


They are still studying and do not have a job yet.


[Senior Citizens]


Most of them were retired and have no other means of income, some are just depending on their pension plans.


Even if we’ll see face to face in the court you will never triumph. What is the use of having that fare rate there posted on your windshield? Consider Manila, the food is more expensive compared here but the drivers there are disciplined in following the fare matrix provided by the LTFRB. Then with loud voice he began uttering a lot of things like, it should be PhP 6.50! Currently, I do not even have the fee for this jeepney! While he was throwing a lot of harsh words, at the back of my mind, I was already thinking of giving all extra coins in my bag. I was reflecting during that moment and have realized that I have relatives who survive through the same profession, driving, I know how hard it is to suffice the needs of one’s family especially if one does not own a jeepney. I slowly opened my bag and got all the coins there, then with smile I gave all those to the driver. We understand your situation, here take these coins, you might be needing it badly for your family. He replied in low tone, thank you child, please do understand us. Then with smile I replied, okay sir, no problem about that. Then the jeepney started rolling. While walking down the street to our house, I have felt an extraordinary happiness.


Being happy is a choice that we make. Never forget this. Everytime we wake up in the morning, it is us who chooses whether to be happy or not. Being happy is not being rich, it is being content with what we have.


Pro Deo et Patria

Monday, May 22, 2006

Kernel head

This is a late post. Simply explains how the kernel sits in after grub.



[BITS 32]

global _start
extern kernel_entry

PAGEALIGN equ 1<<0
MEMORYINFO equ 1<<1
HEADERFLAGS equ PAGEALIGN | MEMORYINFO ; 0x3 that is
HEADERMAGIC equ 0x1BADB002
CHECKSUM equ -(HEADERMAGIC + HEADERFLAGS)
STACKSIZE equ 0x4000

section .text
ALIGN 4 ; section must be 4 byte-aligned
multibootheader ;
dd HEADERMAGIC
dd HEADERFLAGS
dd CHECKSUM

_start:
mov esp, stack+STACKSIZE
push eax
push ebx
call kernel_entry
jmp $

; GDT here

; ISRs here

section .bss
ALIGN 4
stack resb STACKSIZE ; 16KB of memory

I’m just sad tonight, that’s why I decided to post this out of nothing. Well I guess keeping myself busy would be wise enough.

Sunday, May 21, 2006

Sunday, sad discovery

[Da Vinci Code]


I have been to the movie house recently and watched this controversial film. The book, despite its ever-growing popularity, did not interest me that much since I equate my faith with a sword mightier than Tireal’s Azurewrath. I was saddened deeply when I reached the movie house and saw numerous people there oozing with their teenage curiosity. First of all, have they been to church? It’s Sunday for pete’s sake. Why would they prioritize watching a film that is against their religion without even thinking that they have their obligations? Dan Brown’s manuscript is really a work of art and no question about that but people should remember it as a fiction book and nothing beyond.


To all those who have read the book or have watched the film, try reading The Da Vinci Code Decoded written by a Jesuit priest.


[OS Development]


Do not write your own operating system. An information available globally that could be considered as a blackhole where operating system developers might fall. I am one of those enlightened hobbyists who fell into that hole while searching for a supplementary reading about the Global Descriptor Table. Developing your own OS is just reinventing the wheel. Straightforward as it may sound. Yeah right. We want to learn here and reinventing the wheel does not only mean to reinvent. Go grab your processor’s fan, detach it, and power on for a decent devastation.

Wednesday, May 17, 2006

Early take-off

I have emerged vim-7.0-r2 just recently.


Preparing a lot for our college thesis. Not excluding the amount of food intake. Reading the intel manuals from hell. Heavy bondings with bochs, vim, nasm, gcc, ld, strace, objdump, hexedit, as, etc.


Requesting a divine intervention for strength.

Wednesday, May 10, 2006

Making C++ behave like Java

I was sidetracked from my C++ programming (Battle for Wesnoth) by the school’s Senior Summer Trainings 2006. After MySQL and PHP, and a week OJT at Zamboanga Freeport (OMED IT Solutions), the dark side of the force has arrived, Java Programming. We are currently being trained by Ma’am Ebony Domingo and some CS upperclasses who already received their respective diplomas last March of this year. Their spirits of magis uplift my morale and drive me to be more optimistic especially in dealing with a language that I’m not quite familiar with.


Java is known for its being a platform independent language, equipped with an auto garbage collection mechanism, etc. (I don’t want to elaborate more on these).


What I am trying to point here out is that, one of Java’s assets, which is the auto garbage collection, is also possible in C++ using an auto pointer. Now, how is this possible?


What an auto pointer does is, it owns a dynamically created object and automatically performs a cleanup when the object is no longer needed.


First, we have to consider how they normally do it (without auto pointer).



void function()
{
sophie *s(new sophie);
/* do something here */
delete s;
}

A classic memory leak would occur if there’s no delete.


Here’s how it’s being done using an auto pointer.



void function()
{
auto_ptr<sophie> s(new sophie);
/* do something here */
}

Beyond this scope, the object frees automatically.


God bless us all!