Print Story Attention Python Infidels
Software
By Evil Cloaked User (Tue Jul 25, 2006 at 05:08:45 AM EST) (all tags)
What the hell is the "buffer interface" and where can I find a mutable object that implements the read-write buffer interface so that I can actually transfer data from the kernel to Python via an IOCTL as mentioned here?


In other news, work is hellish, but I'm dealing. There's a customer moving from Dublin to Cork tomorrow. The Cork office currently lacks the following:
  • Carpet
  • Paint
  • Internal walls
  • Network Cabling (technically, the cable is there, but there's nothing at either end of the cables)
  • Electricity
The server is being installed first thing in the morning apparently...

MGM and I continue to not drive each other insane. Which is nice. It's still unclear what will happen on the day of her sister's wedding. Last we heard, her future brother in law doesn't want me anywhere near it, not even for the afters, despite having never met me. MGM's dad, whom I have also never met, didn't take too kindly to this and extended a personal invitation for me to come to, I believe, the afters. AFAIK, the groom has not been informed of this.

My American house mate is no more. Now it's just MDB and I. Gradually reclaiming the house as we move stuff into the spare room. It'll be really nice when it's done, but it's gonna take a full month I'd say. MGM is itching to clean the place up and I have told her that I will dump her if she tries. Pretty sure she believes me.

The brother bought me two tickets to this for my birthday!
< If anyone asks, not that they would | BBC White season: 'Rivers of Blood' >
Attention Python Infidels | 20 comments (20 topical, 0 hidden) | Trackback
the buffer interface by komet (2.00 / 0) #1 Tue Jul 25, 2006 at 05:16:28 AM EST
I think a normal list should do as the buffer object. Failing that, try the array module.

--
<ni> komet: You are functionally illiterate as regards trashy erotica.


better yet by komet (2.00 / 0) #2 Tue Jul 25, 2006 at 05:29:39 AM EST
if you use a struct (RTFM module struct), you can get at the data in an ordered manner using pack and unpack.

--
<ni> komet: You are functionally illiterate as regards trashy erotica.
[ Parent ]

Tried both of those. by Evil Cloaked User (2.00 / 0) #3 Tue Jul 25, 2006 at 05:33:56 AM EST
For sending data, I can pack up a struct and it all works swimmingly. For receiving data, a list doesn't cut it i.e. throws an exception. When using an array, it seems happier, and I receive no errors, neither at the kernel side nor the Python side, but also, I receive no data. Same goes for packing up a struct and giving that as the receive buffer.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

I appear to be an idiot - but not like that. by Evil Cloaked User (2.00 / 0) #4 Tue Jul 25, 2006 at 05:43:34 AM EST
Knocked out a C program to mimic the Python. Same behaviour. Oops.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

don't trust the IOCTL by martingale (4.00 / 2) #5 Tue Jul 25, 2006 at 06:03:22 AM EST
Ever since Juan Antonio Samaranch retired, they've been finding all sorts of weird things on the books. My opinion is that the buffer interface is a foregone conclusion, and they should only allow amateurs to play mutable objects.
--
$E(X_t|F_s) = X_s,\quad t > s$


but what about inheritance ? by sasquatchan (2.00 / 0) #13 Tue Jul 25, 2006 at 11:27:18 AM EST
If you feel so strongly about only amateurs playing, can they receive inheritances or be friends with promoters or sponsors ?

[ Parent ]

More Explaining? by Imperial Mince (2.00 / 0) #6 Tue Jul 25, 2006 at 07:25:04 AM EST
Does MGM's future brother in law dislike her?
--
This space reserved for whining like a little bitch and being sanctimonious.


Not that I'm aware of. by Evil Cloaked User (2.00 / 0) #10 Tue Jul 25, 2006 at 10:57:52 AM EST
But MGM's family in general, and father in particular, don't have much time for the guy. I think it's to do with him getting their daughter knocked up at 18 with 2 more kids by the time she was 25. And then waiting another 2 years before getting married.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

I see by Merekat (2.00 / 0) #14 Tue Jul 25, 2006 at 11:31:06 AM EST
And since you have as yet failed to do similar to another daughter, he considers you a threat as you illustrate the possibility of an alternative?

[ Parent ]

Not quite. by Evil Cloaked User (2.00 / 0) #17 Tue Jul 25, 2006 at 12:19:10 PM EST
"I don't want that pink haired fucker at the wedding!" was, I believe, the rather elegant announcement.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

colourblind too by Merekat (2.00 / 0) #19 Wed Jul 26, 2006 at 03:41:57 AM EST
no?

[ Parent ]

Pink vs Red is a bone of contention. by Evil Cloaked User (2.00 / 0) #20 Wed Jul 26, 2006 at 06:08:23 AM EST
At the moment, my hair is very faded and is in fact pink. Even when it's freshly dyed though, it's not as red as I'd like and MGM refuses to acknowledge that it's ever been anything other than pink. The family are getting their info from her, so she's to blame on the pink thing.

Next time I get a hair cut (probably this weekend), I'm gonna bleach it a bit further. Normally, I just let it go blonde, but this time, I'm going to aim for a much paler shade in the hope that the red will take a bit better.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

Sounds like a Good Catholic Boy [n/t] by Herring (2.00 / 0) #18 Tue Jul 25, 2006 at 09:13:33 PM EST


I'm English, and as such I crave disappointment. - Bill Bailey
[ Parent ]

So you killed the American. by jimgon (4.00 / 1) #7 Tue Jul 25, 2006 at 08:19:04 AM EST
Good, good.  Filthy swine, the lot of them, if you ask me. 



I think by martingale (2.00 / 0) #8 Tue Jul 25, 2006 at 08:54:03 AM EST
it may well have been the song
--
$E(X_t|F_s) = X_s,\quad t > s$
[ Parent ]

She had it coming. by Evil Cloaked User (4.00 / 1) #11 Tue Jul 25, 2006 at 10:59:30 AM EST
But despite that, I didn't kill her. She moved out.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

Too bad by jimgon (4.00 / 1) #15 Tue Jul 25, 2006 at 11:35:20 AM EST
You know with woodchucks if you kill one and hang it's carcass from a post it keeps others from showing up on the property. 

[ Parent ]

Well.. by sasquatchan (2.00 / 0) #9 Tue Jul 25, 2006 at 10:15:07 AM EST
What's your OS ?

I mean, I believe in higher languages that really do take care of everything for you, but for sharing data between kernel drivers and user land is very different between platforms.

I can only speak for win32, and even then, the potential problems are numerous. You're trying to use a user allocated buffer. Whatever address that buffer has must be translated from the addressspace of the user process to the kernel space. Then it must point to actual (non-swap) memory, since page faults in kernel drivers are almost universally BSOD material. Etc.

A good write up for it on win32, used when I had to do such things.

So, while there may be a passthrough on python, color me cynical on it working with any/all devices/drivers/OS kernels, since for may devices, it's device dependent (even for the supported IOCTLs)



Linux by Evil Cloaked User (4.00 / 1) #12 Tue Jul 25, 2006 at 11:06:59 AM EST
It's an embedded system so cross platform is not an issue. Got it nearly sorted now. Was actually a problem on the kernel side, not on the Python side.


--
Still, I think most of the problem is just a mental hurdle to overcome, - Cloaked User
[ Parent ]

The Cork office sounds wonderful... by The Fool (2.00 / 0) #16 Tue Jul 25, 2006 at 11:41:40 AM EST
kind of like working at the beach. Do they provide pina coladas and sunscreen?




Attention Python Infidels | 20 comments (20 topical, 0 hidden) | Trackback