Search This Blog

Friday, November 30, 2007

Re: I want to write an OS

Introduction
I am receiving mails from final year students who want to write an OS as their academic project, since most of their mails are almost same and my replies also same, I decided to create a page for that and this is that. Assume you asked the following questions – How many months it will take to create an OS? What book I have to learn to create an OS?...

Knowledge Required
The following are some of the important area where you should be comfortable. It is not necessary to know in and out of everything. For example – it is not necessary to know all the POSIX C library functions and their arguments; however you should through in core C language.
  • C and Assembly (Yes – Assembly knowledge is must)
  • Data structures (Array, Linked List, Binary Tree, Hash…)
  • Compiler, Linker, Object Files, Executable Files
  • Processor Modes – Real and Protected
  • Knowledge in BIOS, Interrupt, ISR, DMA, IO etc
  • Basic Hardware Knowledge
  • OS Concepts
Writing an OS is not an easy task.
If you have knowledge about the above thing then it will take just a year to complete an OS project. :) You should read the following article by Alexei A. Frounze to understand how hard it is, what kind of knowledge needed and the time needed for development of an OS http://alexfru.narod.ru/os/skeptically/OSdevSkeptically.html
Another one from Emmanuel Marty http://osnews.com/story.php?news_id=1482

Impossible?
No I didn’t say that; although developing OS is not an easy task, it is not an impossible one. OS development may take more than what you estimate however it is also possible to complete a working kernel within short frame of time (6 months) by group of students.

Goal
OS is composed of many components or modules. Writing all the modules from scratch will take lot of time (decade(s)). And also all modules are not required for all OSes. So decide what kind of OS you want to write. GUI and Shell are some example for programs which are not needed for an OS. Memory Management, Process Management and Scheduler are the important things; around which you may set your goals. Eg – Some new kind of IPC, Special Scheduler, VM.

Design is the first task to be done for any task
Spend some time to finalize your kernel design before starting coding. Set all modules’s functions, data structure and how they are going to interact/communicate with other modules before start coding.
Kernel is the most important part in OS design. You may find some links related to kernel design from the following link http://en.wikipedia.org/wiki/Kernel_%28computer_science%29.

Set Environment
What makes OS development harder? – The answer is development/debugging environment. Before start coding but after design set your development environment well. GCC and NASM/FASM is compiler/assembler used by most hobby OS developers. Try to learn the options supported by these compilers and assemblers. You should also learn how to link Assembly and C source code. Also you may need to learn about MakeFile and linker scripts.

Although I am using Windows XP for my development, I suggest using Linux as the host machine for OS development because Linux has lot of open source tools related to kernel development. Although Windows port of those tools are available, those are not up to date or they are broken. Linux comes with all the tools that you want to develop an OS; you just have to select them during the installation.

Debugging
To test and debug your kernel, you need either a real machine or a virtual machine (Virtual PC, VMWARE, Bochs, QEmu). WinImage, FileDisk are some tools help to create image files for virtual machines. You also need to know how to debug your kernel.

Management
For a hobby OS developer technical challenge and research is the only thing in custom OS development. If you are creating a kernel for your final year project you should take care of time management also otherwise you can’t complete the project. The classic technique of time management is set timeframe for each activity and to complete it within the timeframe. Here are some macro level milestones. (The percentages are of total time within which the objectives should complete.)
  • Design (25%) (Reading – 15%, Design – 10%)
  • Tools and environment Setup (5%)
  • Grub and Hello World Kernel (15%)
  • Create Real Kernel (30%)
  • Debugging (20%)

Reading
OS Development FAQ
Intel Processor Manual 3 – System Programming
BonaFide OS Development Documents
Art of Assembly
OS Development Forum
Alt.OS.Development

Monday, November 19, 2007

Putty Session Management

Putty handles multiple sessions; however the UI for session management is not so good (Only one combo box). Selecting a desired session is easy; but searching/grouping a session is impossible. Having different setting per session is esay; but copying settings is impossible.

There is a solution available for this and the following is what I wanted

Putty Session Manager - http://sourceforge.net/projects/puttysm/

Also Tutty - http://putty.dwalin.ru/?tutty which is slightly modified version of putty.

Tuesday, November 06, 2007

Internet in India

Broadband

Getting broad internet connection in India still seems to be issue. From discussion forums and blogs, Airtel seems to be comparatively good. Here is my order of preferred ISPs: Airtel, BSNL … (other ISPs) and lastly Tata Indicom. However the problem with Airtel is they are seems to be not giving new connections anymore in many places. BSNL - they and their process takes time. In my place Airtel guys said “currently there is no feasibility and it will take another one month to give new connection”. BSNL said they will give telephone connection immediately but broadband will take minimum 3 months.

Wireless

I gave up on broadband connection and tried to get wireless connection. The only concern which stopped me going for wireless is its initial cost. Airtel USB modem costs 6K and Reliance costs around 4K.

Airtel GPRS - Mobile Office

Few days back I came to know about Airtel’s GPRS scheme “Mobile Office”. No installation charges, no documentation, no application, no waiting…

To use you need a phone with GPRS support with Airtel PostPaid connection and software to share the internet with your PC/laptop. The plan I opt is unlimited download and Rs.140 per week. It converts into 700(140x5) per month which is ~equivalent to a rate of 128KB unlimited broadband connection.

Speed

So far I am getting good speed. The max speed I got is 33KB. This is more than enough for me to browse and download small applications.

Activation, Deactivation is done through SMS

Action

SMS Number

Content

To Activate

6123

MO

To get GPRS settings

2567

ALL

To unsubscribe

222

MO CNCL

However for my Windows Mobile I have to manually configure the GPRS settings. Start->Settings->Connections->GPRS is where you have to create a new connection if you want to configure you Windows Mobile. The only thing you have to input is “Access Point” and the value is “airtelgprs.com”.

To share the internet connection with your PC, click Start in your mobile and select “Internet Sharing”. This will disable the “Windows Mobile” activesync connection and creates a new Network connection – “Windows Mobile based Internet Connection Sharing device”. That’s it, you can browse in your PC.

Happy surfing :)