lenny@icus.islp.ny.us (Lenny Tropiano) (08/08/89)
In article <2229@umbc3.UMBC.EDU> alex@umbc3.umbc.edu.UMBC.EDU (Alex S. Crain) writes: |>In article <637@holin.ATT.COM> bes@holin.ATT.COM (Bradley Smith) writes: |> |>>Now a question. I want select to work on the /dev/window as well |>>(like stdin, stdout) but you can't access data in other loadable |>>devices. I thought of find out what address the struct tty is at |>>and looking at it that way. Does anyone have an idea? |> |> You can access data in loadable devices, *if you know the address*. |>One way of doing this is to link with /etc/lddrv/ifile.wind and assume that |>this info will not change. Another way would be to have uipcinit() read |>/etc/lddrv/ifile.wind (yuk). Since its reasonable to assume that wind.o |>will always be the first driver loaded, then there is no reason that the |>addresses should change, ever, so using that ifile is a reasonably good |>way of doing it. You could justify it by assuming that the window driver |>will someday be replaced, so this is only temporary :-). |> |> ld -r -o uipc.o /etc/lddrv/ifile.wind *.o |> Why not use nlist(3C)? That's what it was made for! All you need to do is to set up a struct nlist with all the symbols (assuming you know the symbol name [which can be gotten with nm or looking at the ifile.wind]) you need and then call nlist("/etc/lddrv/wind",&nl) ... The symbol and their appropriate addresses are returned right there for you. Then you can do what you need with them ... -Lenny -- Lenny Tropiano ICUS Software Systems [w] +1 (516) 589-7930 lenny@icus.islp.ny.us Telex; 154232428 ICUS [h] +1 (516) 968-8576 {ames,talcott,decuac,hombre,pacbell,sbcs}!icus!lenny attmail!icus!lenny ICUS Software Systems -- PO Box 1; Islip Terrace, NY 11752
jcm@mtunb.ATT.COM (was-John McMillan) (08/08/89)
In article <945@icus.islp.ny.us> lenny@icus.islp.ny.us (Lenny Tropiano) writes: : >Why not use nlist(3C)? That's what it was made for! All you need >to do is to set up a struct nlist with all the symbols (assuming you know >the symbol name [which can be gotten with nm or looking at the ifile.wind]) >you need and then call nlist("/etc/lddrv/wind",&nl) ... > >The symbol and their appropriate addresses are returned right there >for you. Then you can do what you need with them ... For speed purposes, you may choose to ALSO keep a binary file with the info. AFTER confirming it is more recent in mtime than /etc/lddrv/wind, you can save considerable time just picking it rather than re-scanning the name list -- the kernel name list is vastly larger than it should be. Alternatively, you can scratch the binary file on re-boots, and build it each first-time it's used -- like most SAR implementations, if I recall correctly. john mcmillan -- att!mtunb!jcm -- mindless sexist GROWLER....
bes@holin.ATT.COM (Bradley Smith) (08/08/89)
In article <945@icus.islp.ny.us> lenny@icus.islp.ny.us (Lenny Tropiano) writes: >Why not use nlist(3C)? That's what it was made for! All you need >to do is to set up a struct nlist with all the symbols (assuming you know >the symbol name [which can be gotten with nm or looking at the ifile.wind]) >you need and then call nlist("/etc/lddrv/wind",&nl) ... This is what I am going to do, although I was using wind.o which gave me some grief, but last night I got win_cnt (actual a variable pointing to the same place) to have 12. My next step is to see if the tty structures are working right on the window driver. If they are then I should be able to get stdin working on the select. Then all I need to do is work on the write bitmasks. -- Bradley Smith Computer Systems Offer Integration Laboratory AT&T Bell Labs, Holmdel, NJ 201-949-0090 att!holin!bes or bes@holin.ATT.COM