L4/Iguana Learning

There is a lot of buzz going around for virtualization systems where a base system (for example L4 based micro-kernel) supporting other real-time operating systems such as Linux variants, WinCE, Symbian, REX etc.

The primary reason is to provide more secure and highly reliable systems to the manufacturer of embedded systems. The GPL license makes a bit difficult for the manufacturers to adopt for open systems as they have to expose their firmware to the public. NICTA initiate is the response to address the smilar issues and provide a high end systems to the market.

http://markustips.blogspot.com

GCC C __attribute__ feature

Most of compilers support optimization level in which each level has special significance to optimize the source in terms of size, performance etc. This can be enabled by specified command line arguments, mostly known as options.

Moreover GCC compiler has a special characteristic additionally – declaring attributes of a function. The source can be optimized at programming level. While writing the source, the programmer has a chance to instruct the compiler to what should be taken care.

__attribute__ keyword is used when a function (declared only) is a declared and the corresponding instruction/s is/are mentioned with it.  There are many ways to do nasty things with it found here.

In the embedded system, the code is nicely put together in different sections according to the design/requirements.  The code goes into the text section. It happens that while starting the OS, it is so better to gather the initialization code together that as soon as the initialization is over, the related code can be removed from the main memory.  This can be achieved by combining initialization code into init section i.e  __attribute__ section(”.init”). This is where my journey has started for attribute feature.

This function attibute has been widely used in L4 micro-kernel, which provides a secured approach for embedded systems facilitating the hardware manufactures to protect their patents/innovation without exposing to the outside world.

There are many things can be done using Linux and GCC pair, but today this is enough to start with.

C Function Calling conventions

  1. __cdecl
  • Standard/default calling convention in Unix/Win32
  • Caller should push and pop the arguments (right to left)
  • Variable number of argument functions such as printf, scanf can be used with because the callee cannot know the number of parameters
  • Freeing stack Instructions are inserted after every call of the function, so it increases the code size if many calls are made
  1. __stdcall/PASCAL
  • Microsoft Win32 supported
  • Arguments are pushed (left to right) by the called and stack is cleaned up by the callee
  • No variable number of argument functions are allowed
  • Conserve some code space (one time cleanup by callee)
  1. __fastcall
  • Microsoft Win32 supported
  • Registers are used for passing arguments
  • The registers are pushed to and popped from the stack (first two arguments are copied into the registers, the rest should resort to the stack by_stdcall fashion)
  • Bit overhead
  • Used for local functions within the module

Check out more detailed explanation

Arguments by Philosophy

Has one ever noticed whether someone or oneself is making sense during the argument or in a discussion? Is there any better way to put the argument or to make it clear without any king of misunderstanding?

Of course, there is one – Critical Thinking.  We have centuries of philosophical concepts and ideas to ponder over.  HongKong University provides open and free course on Critical Thinking. I enjoyed revisiting these concepts, which I have come across from childhood and even have used many times in real life.

Critical Thinking mini-guide is neatly organized materials to start with.  The following are the important excerpts from the guide not to miss.

“Critical thinking is the ability to engage in reflective and independent
thinking, and being able to think clearly and rationally.”

“Critical thinking does not mean being argumentative or being critical of
others. Although critical thinking skills can be used in exposing fallacies
and bad reasoning, they can also be used to support other viewpoints, and
to cooperate with others in solving problems and acquiring knowledge.”

Real time satellite tracking

Recently I have come across this beautiful website which allows to track your location using the satellite. It checks the IP address and locates the Longitude and Latitude – nice home picture. It has hosted the latest CHANDRAYAAN-1 information too.

http://www.n2yo.com

Tip of iceberg

The way the world is interwoven recently, mandates to have a deeper insight in the different culture. Each country is unique in its culture, ranging from the typical behavior to ‘undiscovered’ facets. There are special traits that come in the light of the other culture.

Everyday in this world of globalization, many people come into contact with the other country people for business, education, sports and, planned and unplanned meetings. They interact with each other and sometimes feel so weird about why someone behaves and does a thing in that way. Some accept or don’t care it whereas some ridicule it; but most of the people would certainly agree with me that the outsider to should respect their culture per se. I feel they are right,… ummmm … how?

Each culture derives different habits over a period, and in fact there are many criteria that play important roles such as geography, prehistory, environment, food, language, religion, education, beliefs, trends, demography and so on.  The locals are already aware of and have well accepted these habits. When the outsider, who is unaware of these local habits, come in and notice them; they may feel strange sometimes, because they are trying to see these habits or traits through their own culture’s lens. Most of us see only the outward actions and behaviors that are only a tip of iceberg and we miss to look deep inside what lies below the surface. We should avoid passing the judgment based on what the tip of the iceberg represents.

Iceberg Model

Iceberg Model

When people are involved in the business, it is better to know the other’s culture to understand them well. Sometimes these help the individual to negotiate in a win-win situation. and so It bring competitive advantages for the business.

Nucleus – Interrupt Handling

In most of RTOS, whenever an interrupt arrives, the interrupt vector table’s corresponding routine is invoked to execute some piece of code to take the required action for that interrupt.

Nucleus RTOS had peculiar interrupt handling mechanism which is not found in some of those RTOS mechanism. Nucleus interrupts are handled in two phases called LISR (Low level ISR-Interrupt Service Routine) and HISR (High level ISR) parts.

The LISR routine is similar to existing RTOS’s ISR, but the important difference is if required more processing, it activates the corresponding HISR.  During LISR processing, only limited system calls are allowed and minimal processing is done. This ensures to respond to interrupt in very quick manner and reduces the latency for the same.

The HISR are scheduled similar to the task. They have priority 0 to 2 that are the highest priority levels defined by Nucleus. The remaining 3 to 255 priority levels are given to the tasks.  The lower the priority value, the higher the chances of task or HISR to get scheduled. The HISR can access most of the system calls.

Moreover, whenever the scheduler runs, it checks any activated HISR first. If found, it schedules all HISR before any of the task is scheduled.  This allows to perform the required extra processing in HISR after LISR is executed without spending much time in ISR.

Project10tothe100

Google has come out with a super initiative called a project10tothe100 to help people. It’s so simple, just come out with an idea which can affect lots of people on different categories. The best thing about this initiative is that Google commits to invest $10 million for different kinds of ideas.

Idea Submission date Oct 20. Submit your idea here

Ummmmm… what idea???? I must get one to help people.

How to start singing?

Most of people are interested in singing. Some are really good singers performing in public, but some are bathroom singers. I started with the latter and have sung in choir. It’s really amazing.

Without proper voice or hitting the right notes, singing looks raucous but there is always a  way to learn. I believe that we can train our body or part of the body for the desired function. Some people are gifted with good vocal sounds, and the others can train it.  I found this nice piece of videos on youtube.com which is really helpful who wants to learn the basics of singing. I hope it will be helpful to you. There are three parts and all of them are really good, especially the person has put the things in nice order.

Part1

Part 2

Part 3

The Last Lecture

I have been suggested by one my friend Kerri about this video and the book published on the same recently. This is about a person named Prof Randy Pausch (Oct. 23, 1960 – July 25, 2008) from Carnegie Mellon University and his childhood dreams.

I have gone through this You tube video and really got encouraged and touched by his excellent speech.

I have got the lessons for my life.

1. Look/find something good from every person

2. There is always a way to make things better

Next Page »