Please do not post any link or advertisement on my blog, it will be removed.

Saturday, June 30, 2012

Priorities re-visted

The manager of the team which I’m having internship with was leaving, it was at a farewell dinner, I had a chance to chat with my colleagues. I was on the topic that when a person in the team leaves, the rest of the team starts re-thinking about their priorities, and starts to leave as well; a very experienced colleague taught me a very valuable lesson this night.

I was on the topic of money versus experience on my friend’s facebook some time ago. I said: “internship or part time job, on the most fundamental basis, it is trade. It is the commodity you trade with your boss/host company that is different. And the terms that constitutes a fair or proper trade varies among individuals … … when I say the terms varies with the individual. It is how much emphasis you put in experience or money. In today's world, quantifiable terms such as money, modular credits, and grades tend to be more dominant. I am no exception. I’m a greedy person who wants high remuneration and good experience at the same time, I’d be lucky if the other party is willing to offer me more than what I offer in return.

In other words, my priority in life is money; it has always been that way. My logic was simple, no matter what job you do, good or bad, if you aim for the best monetary remuneration, at least you can see that you are compensated for your time. But one thing I didn’t manage to figure out: why did I think that way? I have been talking about trying to figure out what I want in life for a long time, and I didn’t have the answer. This colleague pointed out a simple fact (rough quote): “A lot of people are constantly trying to figure out what they want in life, but the fact is: you will almost never find out. Just like love: people are always trying to know if that is the love of their life, but you never do. Very few people actually do find out or even achieve what they want in life. They are really lucky. There is really no good answer to what you want in life, some people spend all their time chasing after money, climbing up the ladder, but they find that they are climbing it for the wrong reason; they weren’t happy.”

The learning point I derived from that is: I do not know what I want in life, but I chose money. As always, it was a defensive measure. I mentioned that I am an extremely defensive person who hates to be taken advantage of. So I chose money, this ensures that no matter how bad the job is, at least I am getting quantifiable returns. Not a very smart choice, maybe, but it seem to be the best path I can follow right now.

A friend asked her if she finds me negative, since the views I hold is often considered extremist by my peers. Her reply was really reassuring: “no, he is not, he just have more awareness of things going on.” This gives me good confidence that my train of thought is quite correct. I was very much affected by how people view me due to the events going on around me; I was starting to think that I am indeed being extremist. But I am not. In her words, I am more aware of things going on in the world than my peers do. My peers grow up in relatively protected environment compared to myself. I had to pay my own bills, I have to earn my own upkeep, I was forced to work while others are enjoying their holidays, and even when my peers are also working on internship, they get good allowance from their parents, I don’t. Yes, I’m complaining quite a lot, many of my peers think that it's not a big deal, but it was always a big deal to me, I took it to heart. But I am grateful for some of my experiences, I’ve seen and know that this world is not a pretty place. While the many of them read to 'learn' that the world sucks, I've lived it. For the record, I know I am still extremely shallow compared to the world out there; but compared to many of the rest, I am well better, for now.

I received a lot of compliments tonight as well, and these compliments coming from people I respect, that is really reassuring. Having a mindset different from other people is tough, many people fail to see what you see and tend to think that you’re just an insolent asshole. Mixing with them for long makes you feel like an outcast. When living in a box, you tend to only see the corners and begin to forget about the world outside, you start to accept the box, and think like those with you in the box; and the box gets even smaller. I am glad that there are in fact quite a number of people who agree with me and these people are well achieved in what they do, I am not alone.

Monday, June 25, 2012

Some things are better left un-said

Words of the wise: some things are better left un-said.

I have a notorious reputation for saying the most controversial stuff to people (and in public). That has caused me quite a lot of problems. I was chatting with a friend just now, and it suddenly became apparent that I should know when to keep my mouth shut. I always thought that facts are facts, even if I don't point it out, the stupid are still stupid; the useless are still useless. But my friend presented a better perspective, funny why I've never tried to see it that way. The logic is simple, saying it doesn't change anything or anyone, but it brings hatred towards myself.

A lesson that many had told me in many ways, but learned only now: certain things don't need to be said.

Sunday, June 17, 2012

ROM, RAM, Program, Firmware, Operating System

The terms used in memory systems can be very complex to understand, with so many different kinds of memory; this gets even more confusing when one name can be used to refer to many things, and one thing can be called by many names. In this post, I shall attempt to explain the myriad of names and things in the memory hierarchy. The things that I write below are from my understanding in this area, if there are any inaccuracies in what I write, please do drop a comment, I will be happy to correct it.

ROM - Read-Only Memory

The read-only memory, as its name suggests, contains data which are read-only. But it is not that simple.

To understand the ROM, I should talk about Application Specific Integrated Circuit (ASIC). ASICs commonly refer to customized integrated circuits which are designed in hardware to do a specified task. However, in a broader view, ASICs have 3 main categories: full-custom, semi-custom, and programmable. Technically, ROM is a type of full-custom ASIC, which logic/program is implemented by mask, and cannot be altered after the IC is fabricated, hence the name “Read-Only”. Advances in the IC fabrication processes gave rise to semi-custom and programmable ASICs. In these kinds of IC, the logic/program stored in the IC can be altered using a programmer device. One example of such IC is the Erasable and Programmable Read-Only Memory (EPROM); its name is oxymoronic: since it’s both ‘erasable’ and ‘programmable’, but yet “read-only”.

This gets even more confusing when it comes to larger embedded systems and devices such as the mobile phone. The memory used in these systems is mostly flash memory, a more advanced memory storage compared to the EPROMs. Flash memory is technically classified as Read-Write Memory (RWM), which is capable of both read and write access.

The memory of interest when talking about ‘ROM’ actually refers to the non-volatile memory of a system where the program of the system resides in (non-volatile means the data does not disappear after power supply is cut off) .Technically, a more suitable term to use is “program memory”. The type of memory used as program memory may not be just read-only; they can be programmable, or read/write capable memories.

The term ‘ROM’ has been casually used to refer to the program memory, as well as the program stored in the memory. This is because, although the type of memory used as program memory may technically be programmable or read-write capable, the data stored in the program memory is mostly read-only; it generally doesn't alter itself during runtime.

It is now clear why it gets confusing as ‘ROM’ is used to interchangeably refer to multiple things. For example, when I say that I am “flashing the rom to my phone”; it means that I am rewriting the program memory of my phone with another program.

RAM  - Random Access Memory

By definition, Random Access Memory (RAM) is any integrated circuit that allows stored data to be accessed in any order with a worst case performance of constant time. By this definition, it basically covers all the memory storage devices today, even the hard disk drives. Yes, the HDDs are considered as RAM as well. Although there are significant timing differences when accessing different locations on the HDD, it is still considered as a RAM as it is random access capable. This is because in older times, magnetic tapes were a popular form of memory storage, to access a certain data on a tape, it need to scroll to that particular location (sequential access), in comparison with the tape, HDD is a random access capable memory.

But the above is just the technical definition, the term ‘RAM’ now refers to the main memory of a system.

We’ve talked about the program memory of a system above: the program memory holds the program of the system. The program is basically a set of instructions which the system will perform; it defines what the system will do. But just having the instruction is not sufficient for the system to work: the system will need to handle and work on data. To do that, it needs memory. That is why this memory is known as the main memory, or simply memory.

The main memory and program memory are different in many ways, access timings and technical details aside; the main reason why it is different is due to the difference in functionality: the program memory and main memory have different purpose, and the system should, generally, not alter its own program during runtime.

The program memory stores the instructions for the systems, the tasks performed by the systems is defined by these instructions. The main memory holds the intermediate data of the system, when the system performs some tasks, it will usually require an input and generate an output according to the instructions. In most cases, the input/output can be stored in the main memory and will be accessed when the system needs to use them to perform task.

As one of the key feature of the main memory is its fast random access speed during operation, the term ‘RAM’ is commonly used to refer to the main memory, and lesser used for the original technical definition it stood for. This, however, creates confusion when the same memory is refer to as 'RAM', "main memory" and "memory".

Program, firmware, operating system

Let us being this section by looking at the definition of each item found in Wikipedia:

  • Program - a sequence of instructions written to perform a specified task with a computer.
  • Firmware - the combination of read-only memory and program code and data stored in it
  • Operating System - a set of software that manages computer hardware resources and provides common services for computer programs.

With the above definitions, it is easily seen that a program is part of a firmware, and an operating system is technically a super larger program which is capable of managing hardware resources and running other programs within it.

The confusion arises when different names are used to refer to the same item again.

Let’s look at an example of android: android is an operating system for devices such as mobile phones, tablets, media players; no confusion with that right? The problem: these devices are traditionally devices using small program memory (ROM); the architecture for such devices is called ‘firmware’ by definition. Operating systems are originally terms for computers, where the OS is stored in larger HDD auxiliary memory. However, small operating systems such as Android, while being less powerful than computer OS such as Windows/Mac/Linux, also qualify for the name “operating system” by definition.

This is why the program on a mobile phone can be referred to as both ‘firmware’ and “operating system”. And as mentioned above, it is also casually referred to as ‘ROM’ since it resides in the program memory, which is casually referred to as ‘ROM’ as the memory used as program memory is traditionally read-only memory.

Endnote

I hope my explanation helped clearing up some of the fog. I am still very green in this area, and my knowledge may be superficial. As mentioned above, if there are any inaccuracies in what I wrote, please do drop and comment and point it out, I'd be more than happy to change.