Sidebar Menu

Projects

  • Dashboard
  • Research Project
  • Milestones
  • Repository
  • Tasks
  • Time Tracking
  • Designs
  • Forum
  • Users
  • Activities

Login

  • Login
  • Webmail
  • Admin
  • Downloads
  • Research

Twitter

Tweets by stumathews
Stuart Mathews
  • Home
  • Blog
  • Code
  • Running
  • Gaming
  • Research
  • About
    • Portfolio
    • Info

Linux

Stuff about linux

Hash browns and Assassin’s Creed

Details
Category: Linux
By Stuart Mathews
Stuart Mathews
09.Jan
09 January 2017
Last Updated: 26 December 2017
Hits: 3780
  • Random
  • Gym
  • Linux kernel
  • Git

I have a new found enthusiasm for hash browns in the morning. I know, its a bombshell so I’ll let you compose yourself. Normally I shy away from potatoes because 1) they are boring as hell 2) not very nutritious and 3) I don't have a pot at home or any inclination to roast potatoes. But here we are me and potatoes, potatoes and me together finally united. I have a hash brown every morning now along with 2 poached eggs, 2 grilled tomatos, mushrooms and baked bean. Now you might be wonder how this all comes about and I’ll tell you: I order it out the office canteen everyday, without fail except on weekends – I don’t go to work on weekends.

Besides this, I watched the new Assassins Creed film, which was actually a lot of fun and they did a good job basing it on the aspects of the game. I also bought a free book from the Kindle store about Git. Its called “Pro Git” and its pretty good. Wonder why is was free? Very happy with that. Also had a look at a book about the Linux Kernel at V0.99 which it thoroughly dissects from Bios load up to assembly and real to protected mode transition to even setting up the new protected mode interrupt vectors – bit intense for my weekend, so I settled on Git.

I had a good session at the gym this morning and I actually went for a run today. Basically because I’m taking a break from running (on account of my calf), I usually take the bus but for some reason the bus terminated early and I decided to run the rest of the way. Not bad, eh? Didn’t feel any issue with my calf.

Been using tmux recently – very nice – its a bit like screen but its nicer somehow.

Oh and I cleaned up my flat – its so bloody spanking clean I don't want to wash my dishes.

Heard a guy say of the recent travel disruptions in london: “The last 5 minutes of my journey, took me an hour!”

Char drivers

Details
Category: Linux
By Stuart Mathews
Stuart Mathews
02.Jan
02 January 2017
Last Updated: 08 December 2018
Hits: 3374
  • Programming
  • Linux kernel

Had an interesting day on Sunday - didn’t go anywhere but stayed in and made headway into a Linux Device Drivers book I had purchased a while ago. It was a good time to read it because I’d just finished Linux Kernel Deveopmment(A programmer’s library) and If I’d not read that, well i doubt I’d have made much sense of this book at it takes a lot of topics and theory for granted. For example memory barriers aren’t even discussed in an example unlike the previously mentioned book - however that being said I did find this topic boring anyway so maybe it wasn’t worth the bordem i went through. I’ll use it eventually but this device driver book is more practical in terms of writing kinds of device drivers.

I did find that the kernel sources have moved on quite a bit since the book was published, some of the function calls have been renamed but not by a great deal - for example in the drivers/char/dsp*.c driver you can see that instead of calling device_create_class(), its just create_class() - Also it made me realise how important the sources are for examples and reference. 

Brain scheduling

Details
Category: Linux
By Stuart Mathews
Stuart Mathews
31.Dec
31 December 2016
Last Updated: 08 December 2018
Hits: 3312
  • Programming
  • Linux kernel

So I’ve finished reading my latest on the Linux Kernel which is good but that certainly doesn’t make me a kernel developer – far from it. I’ve got a good appreciation for the subsystems in the source tree now enough to start hacking it and figuring it all out. My only concern at this point is time. Time is something we all have but its relative (apparently) to the priorities and interests in your life. For example, if you’re interested in running now, well you’ll have lots of time relative to running, less time say to reading or writing about the kernel. So I’m always at odds with what’s more interesting/important/cool in relation to anything else that needs my time. Come to think about it, I guess I’m much like the scheduler in the kernel. Determining what is the best usage if my time. Only the real difference is that my criteria are more numerous to the linux kernel. For example, the scheduler just needs to do that which hasn’t been done enough of yet(run processes that haven’t run as long yet as all the other processes that have ) in comparison to everything else that has done things.

Kernel progress

Details
Category: Linux
By Stuart Mathews
Stuart Mathews
29.Dec
29 December 2016
Last Updated: 08 December 2018
Hits: 3465
  • Linux kernel

Ok so I;m back at work and that means two things, my day is pretty full up with my day job, which is fine/cool ‘cos I like doing AppV stuff. Just need to re-focus a bit so my work on the kernel has slowed down. That said on the bus last night and this morning. I read up on the VFS abstraction interface provided by the kernel. Mostly learned about the superblock ,inodes and dentries.

Its that period after Christmas and just before new years that everyone has taken off, so it pretty quite in the office. That's actually pretty cool because a) no ones asking me questions and b) its quite and c) I can turn my music way up. I mean at times the lights just go off and I’m sitting in front of my monitor and I have to occasionally do a ninja kick move to re-activate the motion sensors to get the lights to go back on.

Forward march Kernel!

Details
Category: Linux
By Stuart Mathews
Stuart Mathews
27.Dec
27 December 2016
Last Updated: 08 December 2018
Hits: 3576
  • Linux kernel

I finally started scratching an itch I’ve been having for a while – device drivers - and leaning exactly how the Linux Kernel internals function. Stuff like process creation, memory management, threads etc.

Its taken a while to begin this work mostly because I know its a big-start, it requires a lot of time to invest in reading and figuring stuff out and really what this all boils down to, is that it needs continuity.

By continuity I mean that it requires learning a lot to just get a little knowledge, so you need a lot of time to actually get somewhere. For example, you need to read a bunch of theory around processes and scheduling and kernel data structures not to mention how the hardware interfaces with the processor and the OS etc… So you need to have time to do that, and If I know that I’m just not able to provide that, a little bit here and there will be a lost cause. You need to tie things together and ‘things’ only become things when you’ve invested the required time to know what they are.

Hello kernel

Details
Category: Linux
By Stuart Mathews
Stuart Mathews
24.Dec
24 December 2016
Last Updated: 26 December 2017
Hits: 3311
  • Linux kernel

I wrote my first kernel model code today. It was in the form of a loadable module which I compiled and loaded into the running kernel. Interesting how easy it was. They really do seem to try and make it as easy as possible. I guess this is in the spirit of having other people do stuff for you because a) they can and b) its easy so you don't have to do it. Veru clever.

I tried to load my module into Fedora and it frankly wasn't impressed. It told me that my module was unsigned and that it 'tainted' the kernel... Mphh! Anyway thats because the kernel in Fedora 25 is compiled such that it only accepts signed code. Fine I guess so short of compiling a new kernel for Fedora 24, I switched to my Debian VM and loaded it module and its was all good.

A quick dmesg revealed the power of my achievement - 2 words - "hello kernel!".

What's particularly gratifying is the usage of the kernel's printk() function from the kernel API which is similar to user-mode printf().

I couple of weeks back I started reading a book about Linux device drivers and while it was interesting I slowly lost interest somewhere between block drivers and graphics drivers, piqued interest around the USB subsystem drivers and then well put the book down. The problem is just that. Unless you have a problem to solve, it just doesn't do enough for you. So, I having thought about it I'd like to write a USB device driver. The problem now is for what?

Maybe its time to 'make' a device. Oh yes. That's  a suitable problem to overcome. Then it will be to plug that device into a computer and have it commnuicate with it - that's right a device driver!

Anyway today, I downloaded the latest kernel source code, compiled a default configuration for x64 and had a quick browse through the source - time to put my bib and start feasting.