A new blog

October 7th, 2008

While reading the 2.6.27-rc9 announcement email today (looking for fixed bugs, of course) I found this:

PS. I already bugged people on the git lists with this, but since I’m
totally shameless and can’t help but hope that some random kernel person
also does tcl/tk or just wants to help improve my kids-time-tracker, I can
just point to

http://torvalds-family.blogspot.com/2008/10/tracking-time-kids-spend-online.html

and hope that somebody would like to make that GUI better and/or feel like
they really want to do a “management interface” too ;)

I got a bit confused because the keywords that blinked in my brain were “git”, “tcl/tk”, “kernel”, “kids” and “family”.

Then I discovered that Linus has a blog now and the coolest thing about it is that it is not just another tech- or kernel- blog, he is going to talk about his family too.

That is cool because I am always looking for ways to improve my son’s education and there are not lots of kernel hackers’ blogs about that out there. :)

Compiladores

September 8th, 2008

Compiladores é um dos assuntos da computação que não sei absolutamente nada sobre ele mas gostaria muito de aprender um pouco.

Infelizmente não vou ver nada sobre isso na faculdade, pois o curso que estou fazendo é de tecnologia e não tem muito sobre softwares de sistema no currículo.

Vou ter que aprender sozinho.

De vez em quando, ao longo deste ano, eu faço uma pesquisa sobre os livros disponíveis. Qualquer aluno de computação sabe (ou deveria saber) que o livro do dragão é a referência sobre compiladores. Eu dei uma passada rápida em alguns capítulos e gostei do livro, o único problema é que eu gostaria de algo mais prático.

Eu achei o Crafting a Compiler with C. Este parece ter uma abordagem muito mais prática. Acho que vou começar com ele, quando quiser me aprofundar na teoria compro o livro do dragão.

O problema agora é tempo. Só vou ter tempo de mexer com isso quando terminar a faculdade. Se tudo ocorrer bem isso deve acontecer no final do primeiro semestre de 2009.

Para você ter uma idéia de como essa vontade me persegue: no começo do ano estava conversando sobre isso com o Paulo (aka pcpa, se você nunca ouviu falar nele basta dizer que ele é o autor do driver vesa do X, e já escreveu um interpretador LISP, é um dos hackers que conheço pessoalmente que mais admiro) ele disse que também tinha interesse no assunto e que estava escrevendo uma máquina virtual. A descrição da máquina dele me empolgou.

Nessa época eu estava lendo o Inside the Machine e bem no começo do livro o autor apresenta uma descrição de uma máquina extremamente simples que não tem nenhuma utilidade prática, a não ser ser discutida num livro de introdução a arquitetura de computadores.

Não teve jeito… Fiz o projetinho da máquina virtual e escrevi um assembler para ela ‘na loca’ (ie, sair escrevendo código sem pensar muito e sem ter embasamento teórico sobre o assunto). O código está aqui. Embora o assembler tenha funcionado eu nunca cheguei a implementar a maquininha virtual…

Hacks do final de semana

July 1st, 2008

Meu filho tem uma certa mania de jogar celulares em baldes com água ou algo que se pareça com isso. Primeiro foi o celular do meu pai (relativamente caro) que ele jogou em um balde com cândida no ano passado. No último sábado ele jogou o nosso celular na privada.

Eu dei o celular como morto logo de cara (não gosto de celulares). Alguém sugeriu usar um secador, mas não temos. Minha esposa abriu o celular todo, secou e limpou tudo o que foi possível. No domingo de manhã ela montou, ligou e o bicho renasceu. Um a zero para o celular.

O outro acontecimento interessante foi que o boto emprestou a máquina dele para usarmos no final de semana. Domingo à noite, minha esposa foi tentar apagar algumas fotos para abrir espaço e acabou apagando tudo. Ok, eu havia copiado as fotos de sábado, mas todos ficaram tristes achando que as fotos de domingo tinham ido para o céu dos bits.

Tentei googlar por algum programa para recuperar as fotos mas só encontrei para Windows (não tenho Windows em casa, e no wine não funcionou). Cansei de procurar. Pensei em escrever um programa para abrir o dispositivo do cartão de memória e dumpar tudo o que se parecesse com uma foto. Funcionou para grande parte das fotos (código aqui). Falei sobre isso com o pessoal do trabalho e o Caio sugeriu o Photorec, este recuperou 100%.

Pelo menos o programinha serviu para minha esposa ir dormir feliz, bom pra mim. :P

Oia eu sô

JOS Virtual Memory (part 2)

May 5th, 2008

Introduction

This post will briefly explain what copy-on-write fork() is, then we will discuss JOS’s very particular copy-on-write fork() implementation which is mostly done in user-space.

Hopefully this post will give you a good understanding of the system calls presented in the first part of this series.

To be honest, I am not sure whether copy-on-write fork() is the best example for beginners, but it is very helpful to demonstrate how exokernel implementations move functionality normally implemented in kernel-space to user-space.

I recommend you to read the first post of this series if you have not done so yet.

Read the rest of this entry »

JOS Virtual Memory (part 1)

April 15th, 2008

Introduction

In my last post I mentioned I was writing about JOS’ virtual memory implementation. At first, I was going to write only one post but I have written so much that I had to split the post into two parts.

The first (this one), will talk about the exokernel design and will have a first look at JOS’ memory management interface with user-space.

The second post will explain how the system calls presented in the first post work. But, instead of a boring explanation, I will show how the system calls fit together to implement a real JOS’ feature: fork() with copy-on-write support. This feature is impressive because it is done mostly in user-space.

For both posts some background in memory management and operating systems is needed. For those who have learned it but forgot the details, the wikipedia article on virtual memory seems to be sufficient. If you have never studied this subject before, I recommend you to read the memory management chapter from some operating systems book (I have learned from Tanenbaum’s).

Something important to bear in mind is that I am just a beginner on this subject. Everything I know I have learned while working on JOS, so it is likely that you will find mistakes in this text. If you do, please, let me know by sending me an email.

Read the rest of this entry »