Kernel Synchronization Methods
My personal notes and summary from chapter 10 of the book Linux Kernel Development
- Kernel provide two sets of interface for atomic operation : operate on integers, operate on bits
atomic_t: special type used to replace
int in atomic operations.
- easy identify of atomic operations
- ensure the data type not passed to non-atomic operations
- ensure compiler does not optimize in way to break atomic operation
- hide architecture-specific differences of implementation
atomic_t is done in usual manner
- can use
ATOMIC_INIT(0) to set a initial value
- implementations of these operations can be found in
Bottom Halves and Deferring Work
My personal notes and summary from chapter 8 of the book Linux Kernel Development
Bottom halves of interrupt handle work can’t be done in the Top halves.
Top halves should be used for work that is time sensitive, relates to the hardware, and need to ensure another interrupt does not interrupt the work
The Original “Bottom Half”
- a list of 32 statically created BH
- each BH represent by a bit in 32-bit integer
- No two could run at same time
- Pro: Simple
- Con: inflexible and bottleneck
My personal notes and summary from chapter 7 of the book Linux Kernel Development
Side note: This post is written using Mou markdown editor, still playing around with the stylings. Can’t seem to ever get a good way to display code, the way I want it to. Just bare with me for now.
Interrupts and Interrupt Handlers
Unless you have been living under a rock, you would have heard the new Iphone 5 is out.
And the world is going crazy over it.
Unless the previous Iphones, this time I actually seriously considered getting it. Note I have only considered the idea.
I am at a point in my life where I need a new phone. My old Nexus S is getting sluggish, being only almost two years old it is kind disappointing. Me being a long time Android user and who makes a living on developing Android kernels, I naturally start looking at all the top of the line Android phones. And they all seemed to have one thing in common, the screen size for all of them is at least 4.3 inch, almost around 4.7 inch mark.
My first ever cell phone was a Sony Ericsson W580. It was a nice phone back in the days, but the main reason I got it was because of it’s form factor. IT WAS SMALL. What happened to that. I remembered there was a time phone manufacture aimed for small. I really miss that. My first smart phone was the HTC Desire. And I loved everything about that phone: the 3.7 inch display; the metallic frame; the optical curser. It was in a way perfect for me.
I am not saying that big phones are bad, but I personally don’t like it. If I want a big screen device I would use my Nexus 7 tablet for it, or use my laptop which both I carry with my everywhere anyway. So I would just need a small device that can be with me all the time to do phone calls, text, and check emails.
So that is why I was seriously considering getting a Iphone, because it is the only smart phone out there that still have a small form factor. 4 inch screen is still very desirable compare to the other choices.
After doing a lot of research, all the phone plans are ridiculously expensive. In the end I think I am just going to get a unlocked Iphone 4s and get a pre-paid AT&T plan. But I would really like to see trend for small phones to come back.
Maybe the only reason I like small phones is because I am not trying to compensate for anything! :p