"
Kernel Music Player



Languages»


Kernel Music Player

Technologies used: C

My operating system's final project entailed developing a self-picked project. Any project was fine as long as it was related to the core principles of the course. I ended up receiving permission to futher develop netcat's Cycles per Instruction linux kernel module.

Netcat is a group from Seatle and they were the first to release songs from their album as a linux kernel module.
The idea behind it was that their songs would be 'encoded' in such a way that no one would be able to listen to them without using their kernel module.
The magic happens in the following fashion:
1) Get an ogg file and open it as binary file
2) Read every byte in the file and think of it as a number in the range [0...255]
3) Transform this number to a string of 6 characters (bytes) representing the number in hexadecimal
4) Write down each string to a text file -> the array format

The ogg file would have then been transformed into an "array" that would give any music player a headache.

Each track is associated with a .c (trk1.c) file, which simply initialized an array with the contents of the corresponding array track file (trk1data.h). when this file is compiled the hexadecimal string goes back to binary.

My work includes:
1) Changing the creation of the device node to be read/write
2) Implemented a device_write routine to get user commands from a terminal
3) Implemented the device_read routine to deal with those commands
4) The following commands are accepted:
      - Next song (n)
      - Previous song (p)
      - Go to track ( 0 … 9 )
      - Random play (r)
      - Go to the beginning of the track (b)
      - Stop playing (s)
5) Implemented two C programs to convert from ogg to array and back from array to ogg
6) Created a bash script file which allows users to easily add songs to the kernel's playlist

AKA: You're using a kernel module to simulate an iPod's functions through a terminal



This project's code will be up on GitHub pretty soon.
Click here to download my presentation on the project.




GitHub
Resume

Interested?

Contact me at: flaviarc[AT]iastate[dot]edu