Hello guys,
I was studying the sourcecode of OpenBSC to get a good understanding of how things work. But due to my lack of experience in Linux programming I have some difficulties to understand the source.
I understand that the way bsc_hack works is based on event-queue concept, am I right? Anyway, in select.c I don't understand what's going on when it comes to registering and unregistering fd's in combination with linuxlist.c.
Can someone please give me some links where such concepts are being explained, so I can study it? Thanks in advance.
Hi!
On Tue, May 26, 2009 at 05:18:53PM +0200, Nordin wrote:
I was studying the sourcecode of OpenBSC to get a good understanding of how things work.
good!
But due to my lack of experience in Linux programming I have some difficulties to understand the source.
I understand that the way bsc_hack works is based on event-queue concept, am I right?
we don't really have queues of events, so I think no.
Anyway, in select.c I don't understand what's going on when it comes to registering and unregistering fd's in combination with linuxlist.c.
well, basically any part of the program can register a file descriptor object (struct bsc_fd) with select.c. As part of the object, you specify * which file descriptor * whether you are interested in reading from it or writing to it * a call-back function to be called when fd becomes readable or writable
select.c takes care of the event-loop, i.e. it will get notified by the operating system once any of those file descriptors is readable/writable, and then call the respective callback functions.
but that happens synchronously, i.e. a file-descriptor is available for reading, then the select.c code calls the respective callback, which then issues the actual read() system call. Afterwards, it processes the data from the filedescriptor and does whatever it wants. When it returns to the select.c code through the stack up to the callback and back into the select.c code, we process the next file descriptor.
Hi guys,
I added SI 13 structure to "support" GPRS, just to test my PDA-phone out. What I did after defining SI 13 struct is just this bsc_hack.c:
static const struct bcch_info bcch_infos[] = { { .type = RSL_SYSTEM_INFO_1, .len = sizeof(si1), .data = si1, }, { .type = RSL_SYSTEM_INFO_2, .len = sizeof(si2), .data = si2, }, { .type = RSL_SYSTEM_INFO_3, .len = sizeof(si3), .data = si3, }, { .type = RSL_SYSTEM_INFO_4, .len = sizeof(si4), .data = si4, }, /* our SI 13 struct object for faking GPRS */ { .type = RSL_SYSTEM_INFO_13, .len = sizeof(si13), .data = si13, }, };
I assumed that this is the way to put SI 13 in the BCCH. Should that be enough, or am I thinking too easy? It might be a silly question, but I'm studying 4, 5 things at once, which freaks me out sometimes.