<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 1, 2012, at 8:05 PM, Tarl Neustaedter wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On 2012-Nov-1 18:56 , Programmingkid wrote:<br><blockquote type="cite">How would I add a device to the device tree, and be able to open that device using open-dev? I am trying to add "/pseudo-hid/keyboard" to the device tree. I need to test out a new keyboard word that I am adding.<br></blockquote><br>Assuming "/pseudo-hid" already exists and is openable, it would be something like:<br><br>ok select /pseudo-hid<br>ok new-device<br>ok 0 0 0 0 set-args \ This assumes that encode-unit and decode-unit in psuedo-hid don't expect a unit address<br>ok " keyboard" name<br>ok : open true ;<br>ok finish-device<br><br>That should be the absolute minimum for where you can then do a "select" of /pseudo-hid/keyboard<br><br>For putting in the sources later on, it gets more complicated, but for debug, the above should work.<br><br></div></blockquote></div><div><br></div><div>What is the C way of doing this? I have looked at the DECLARE_NODE function. I think it is what I need, but I could not figure out how to make it work. I found this snippet in mac-parts.c. </div><div><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">DECLARE_NODE( macparts, INSTALL_OPEN, </span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><span style="color: #bb23a0">sizeof</span></span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">(macparts_info_t), </span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><span style="color: #d0271c">"+/packages/mac-parts"</span></span><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "> );</span></div><div><span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; "><br></span></div><div><font class="Apple-style-span" face="Menlo"><span class="Apple-style-span" style="font-size: 11px;">What I tried was this:</span></font></div><div><font class="Apple-style-span" face="Menlo"><span class="Apple-style-span" style="font-size: 11px;"><br></span></font></div><div><font class="Apple-style-span" face="Menlo"><span class="Apple-style-span" style="font-size: 11px;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">DECLARE_NODE( keyboard, INSTALL_OPEN, <span style="color: #bb23a0">sizeof</span>(int), <span style="color: #d0271c">"+/pseudo-hid/keyboard"</span> );</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">It didn't work. I am working with the file adb_kbd.c. </div><div><br></div></span></font></div></body></html>