<dan2>
where you are using the same fd for read/write
<jason_>
Maybe.
<jason_>
I'm checking it out :p
<dan2>
jason_: ahh, the unix manual says its where there is an exception on the fd
<jason_>
I'm assuming though that you can use the same descr in both lists read and write.
<jason_>
Alright, so something bad happened.
<dan2>
jason_: what happens if you try to use the same one in both lists
<jason_>
I dunno :p I'm playing around with it right now.
* dan2
wonders if he's waiting for a socket fd, what does it do when its finished
<dan2>
I mean obviously its a different fd right?
<jason_>
What do you mean?
<jason_>
When it's done selecting?
<jason_>
It just waits until a decr is ready from its list, and then returns a tuple with a list for each of the types of descr.
<jason_>
Basically, all of the ones that were ready.
<dan2>
jason_: but I mean, how do I specify which fds will be ready
<dan2>
jason_: socket returns an fd
<dan2>
so how does select know if it can get that fd
<dan2>
or how does it add it to its list or something
<jason_>
Because you send it to it.
<dan2>
jason_: I'm lost now
<jason_>
You say "Thread.select [oneSocket, twoSocket, threeSocket] [] []
<dan2>
sure
<jason_>
And it waits until one of those descrs can read, and returns a tuple with three lists.
<jason_>
Or write or something can be done with one of them.
<dan2>
you are missing something
<dan2>
how does select know what fds are available to it
<jason_>
Then, you pattern match on that list, split up all of the channels, and read from the ones that can be read, and write to the ones that can be written to.
<jason_>
I don't think I understand your question.
<jason_>
Like, how does it know when they're ready for input or have output?
<dan2>
no
<dan2>
how does it know which fds are available to it
<dan2>
jason_: ok
<dan2>
let me try and give an example
<dan2>
I've got 5 threads
<dan2>
god this isn't working
* dan2
doesn't know how to explain it
<dan2>
jason_: ok, if the thread runs through once, and it listens on the same fd, its unlikely it will ever get run again right?
<jason_>
Maybe the fd didn't have any input at the time that it ran?
<dan2>
jason_: no, that has nothing to do with it
<jason_>
It would loop through again, find out it had input the second time around, and process it.
<dan2>
jason_: its really hard for me to explain this
<dan2>
if it runs through once
<dan2>
its likely that fd will never be seen again
<dan2>
so do you have to make mutable fds or something
<dan2>
so that the same names will always work
<jason_>
So, you want to add new sockets dynamically or something to this list?
<jason_>
Like, tell me what you're trying to do specifically.
<dan2>
jason_: yes, add sockets dynamically to the list
<dan2>
thats what I want
<jason_>
I have an example if you want.
<dan2>
could I see that, with threads in it
<jason_>
Wait, lemme try it with two sockets.
<jason_>
That'll be more interesting.
<jason_>
And, illustrate its use better.
<jason_>
I'm just ctrl-king stuff, so it's gonna be sloppy :p
<dan2>
ok
<jason_>
Hm, know a server that outputs text on entry?
<dan2>
an echoserver
<dan2>
jason_: echoservers are pretty easy to implement in any lang
<dan2>
jason_: where is it?
<jason_>
What?
<jason_>
The source?
<jason_>
I'm still trying to get it to work with two sockets.
<jason_>
Yeah, I'm trying to think why esp wouldn't have the right value to begin with.
<jason_>
Is it just fileld with garbage or something?
<purevoid>
grub doesn't setup the stack I don't think
<jason_>
Hm.
<purevoid>
it has docs on what's set, what's not set, and things along those lines
<jason_>
So, why only 32k?
<jason_>
Like, the upper 16k would be your heap right?
<purevoid>
I got it from example linker script
<jason_>
Hm.
<purevoid>
if it turns out to be not enough, I can always change it later
<jason_>
Yeah.. What I'm thinking is, the stack grows upwards.
<purevoid>
most of my code came from the osfaq2 wiki
<jason_>
Like, from the lowest address to the highest.
<jason_>
And.. Hmm. Like your kernel is what works with the MMU.
<jason_>
Sets up all of the memory tables and that garbage.
<jason_>
I mean, are you already in a virtual memory address space at this point?
<purevoid>
yeah, it has to do just about everything
<purevoid>
no
<jason_>
Right.
<purevoid>
only in protected mode
<jason_>
Hm.
<purevoid>
even gdt, interrupts, all that jazz needs to be set up
<jason_>
Yeah, I know that much.
<jason_>
I've never made my own kernel, but I've done a lot of driver development and such.
<purevoid>
grub does a bit, like probing memory, querying vesa modes, and stuff
<purevoid>
ohh ok. we want to write drivers in OCaml :)
<purevoid>
along with everything else
jason_ has quit [Remote closed the connection]
mlh has joined #ocaml
davidmccabe has quit [Read error: 110 (Connection timed out)]
Submarine has joined #ocaml
purevoid has quit [Read error: 113 (No route to host)]
CLxyz has joined #ocaml
mrsolo_ has joined #ocaml
mrsolo has quit [Read error: 113 (No route to host)]
smimou has joined #ocaml
kinners has joined #ocaml
bloggsie has joined #ocaml
zzorn has joined #ocaml
bloggsie has left #ocaml []
siDeb_FR31 has joined #ocaml
_fab has joined #ocaml
kinners has quit ["leaving"]
mattam has joined #ocaml
Ospite461202691 has joined #ocaml
Ospite461202691 is now known as _JusSx_
mlh has quit [Client Quit]
srv_ has quit [Read error: 104 (Connection reset by peer)]
srv has joined #ocaml
siDeb_FR31 has quit ["Leaving"]
_fab has quit [Remote closed the connection]
gim has joined #ocaml
drewr has joined #ocaml
oberke has joined #ocaml
jeff2 has quit [Connection timed out]
skylan_ has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
vezenchio has joined #ocaml
stef has quit [Nick collision from services.]
stef_ has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
vincenz has quit ["leaving"]
srv has quit ["Lost terminal"]
malc_ has joined #ocaml
srv has joined #ocaml
vincenz has joined #ocaml
pango has quit [Nick collision from services.]
pango has joined #ocaml
dobrek has joined #ocaml
CosmicRay has joined #ocaml
mrsolo has joined #ocaml
CosmicRay has quit ["Client exiting"]
mrsolo has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
_fab has joined #ocaml
<dan2>
how do you express function pointers in camlidl
_JusSx_ has left #ocaml []
<dan2>
anybody here
<oberke>
well yes
<dan2>
oberke: you know how to do the above?
<oberke>
nope, sorry !
<dan2>
anyawy
mrvn_ has joined #ocaml
oberke has quit ["Leaving"]
<dan2>
mrvn: how do you make C bindings for ocaml when the c function has a function pointer
<dan2>
oops
<dan2>
address that to everyone
<Demitar>
dan2, I'm not sure camlidl can do that right now.
<dan2>
Demitar: yeah, camlidl wasn't working
mrvn has quit [Read error: 110 (Connection timed out)]
<dan2>
Demitar: I need it to get libevent
<dan2>
and I really want libevent
<dan2>
Demitar: libevent uses the fastest for the job, select, poll, epoll, kqueue etc, and it calls a cb function upon change, which is the way it should be
<Demitar>
It's fairly tricky. It involves closures and you have to be sure it's actually a good time to call back into caml.
<dan2>
heh
<Demitar>
dan2, have you read the relevant section of the manual?
<dan2>
Demitar: which would that be
<Demitar>
Did you look in the manual before asking?
jason_ has joined #ocaml
<jason_>
Hm.
<jason_>
Do you guys know of any software packages that would act like a simulated person?
<jason_>
Like, via text.
<mellum>
M-x doctor
<jason_>
Sweet :0
<jason_>
A site maybe?
<Demitar>
jason_, that's emacs.
<jason_>
O.o
<mellum>
> Do you guys know of any software packages that would act like a simulated person?
<mellum>
Is it because would act like a simulated person that you came to me?
<mellum>
Hm.
<jason_>
Lol.
<dan2>
Demitar: the manual doesn't cover function pointers
<Demitar>
jason_, google for eliza, alice and others.
<jason_>
Ha, yeah, that's it!
<jason_>
Eliza.
<jason_>
I remember now.
<dan2>
Demitar: I tried typedefing, but camlidl wouldn't let me do it
<Demitar>
dan2, "18.7 Advanced topic: callbacks from C to Caml"
<jason_>
Hm. Is there a way to bind Alice to Ocaml?
<jason_>
Is this like, a C library?
<mellum>
It would probably be easier to just use a seperate program and communicate by I/O.
<jason_>
Hm.
<jason_>
I'd kind of like to customize the bot.
<jason_>
Hm.. I found a C++ implementation.
<jason_>
I bet I can just swig it.
<jason_>
Man.. This is going to rock :)!
<jason_>
I'll need to add a delay so it seems a bit more realistic :p
<mellum>
An IRC bot? Yeah, really exciting. Never seen that before ;)
<jason_>
No.
<jason_>
For something else.
<Demitar>
In general alice is a fairly companion. It's just a big database.
<Demitar>
s//boring/
<jason_>
Yeah.
<jason_>
I'm predicting it's good enough.
davidmccabe has joined #ocaml
<judge>
jason_: did you find j-alice.org?
Submarine has quit ["Leaving"]
smimou has quit ["?"]
davidmccabe has quit [Read error: 110 (Connection timed out)]
dobrek has quit ["leaving"]
jason_ has quit [Read error: 110 (Connection timed out)]