{"action":"created","issue":{"url":"https://api.github.com/repos/tock/tock/issues/1118","repository_url":"https://api.github.com/repos/tock/tock","labels_url":"https://api.github.com/repos/tock/tock/issues/1118/labels{/name}","comments_url":"https://api.github.com/repos/tock/tock/issues/1118/comments","events_url":"https://api.github.com/repos/tock/tock/issues/1118/events","html_url":"https://github.com/tock/tock/issues/1118","id":341692120,"node_id":"MDU6SXNzdWUzNDE2OTIxMjA=","number":1118,"title":"RFC: Reorganize Capsules Directory","user":{"login":"bradjc","id":1467890,"node_id":"MDQ6VXNlcjE0Njc4OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1467890?v=4","gravatar_id":"","url":"https://api.github.com/users/bradjc","html_url":"https://github.com/bradjc","followers_url":"https://api.github.com/users/bradjc/followers","following_url":"https://api.github.com/users/bradjc/following{/other_user}","gists_url":"https://api.github.com/users/bradjc/gists{/gist_id}","starred_url":"https://api.github.com/users/bradjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradjc/subscriptions","organizations_url":"https://api.github.com/users/bradjc/orgs","repos_url":"https://api.github.com/users/bradjc/repos","events_url":"https://api.github.com/users/bradjc/events{/privacy}","received_events_url":"https://api.github.com/users/bradjc/received_events","type":"User","site_admin":false},"labels":[{"id":763656645,"node_id":"MDU6TGFiZWw3NjM2NTY2NDU=","url":"https://api.github.com/repos/tock/tock/labels/rfc","name":"rfc","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-07-16T21:53:33Z","updated_at":"2018-07-30T17:21:48Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently we have a single directory which contains all capsules. However, capsules can be used in a variety of ways, as illustrated by the [README](https://github.com/tock/tock/blob/master/capsules/README.md):\r\n\r\n```\r\n- Sensor and other IC Drivers\r\n- Libraries\r\n- MCU Peripherals for Userspace\r\n- Helpful Userspace Capsules\r\n- Virtualized Sensor Capsules for Userspace\r\n- Virtualized Hardware Resources\r\n- Utility Capsules\r\n```\r\n\r\nIt's probably a good thing we are seeing a variety of different types of capsules since all capsule code cannot use unsafe.\r\n\r\nAs the list of capsules gets longer, however, it gets more and more difficult to manage the flat list for at least three reasons:\r\n\r\n1. Finding groups of capsules (for example to find the ones that provide a `Driver` interface) is challenging. Finding groups would help with finding capsules which are not virtualized, for example.\r\n2. Finding capsules to copy from if you are implementing a new capsule is daunting.\r\n3. The flat list doesn't provide any information about how that capsule is likely to be used, so finding that can mean inspecting each file individually.\r\n\r\nBased on this, I think we should have subfolders for capsules.\r\n\r\nOpen Questions\r\n----------------\r\n\r\nThe main question, if you agree with adding folders, is: which folders should be added?\r\n\r\nCurrent Solutions\r\n------------------\r\n\r\nI know of two things we are currently doing-ish that help with this:\r\n\r\n1. The README groups capsules into reasonable categories.\r\n2. Some capsules have the file name appended with `_driver` if they provide a `Driver` interface, or `virtual_` if they provide a virtualized hardware peripheral interface.\r\n\r\nInitial Proposal\r\n---------------\r\n\r\nWhile the readme groups mostly based on what the device the capsule interfaces with does, I think a more useful folder-level grouping would be based on characteristics of the code. The characteristic that stands out the most to me is whether the capsule implements `Driver` or not. So, I think a start would be to create a `drivers` folder and put all of the capsules that provide a syscall interface in that folder.\r\n\r\nIn some cases capsules do multiple things, and in any organization scheme those capsules may fall into multiple buckets, so likely some case-by-case discretion would be needed.\r\n"},"comment":{"url":"https://api.github.com/repos/tock/tock/issues/comments/408942820","html_url":"https://github.com/tock/tock/issues/1118#issuecomment-408942820","issue_url":"https://api.github.com/repos/tock/tock/issues/1118","id":408942820,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODk0MjgyMA==","user":{"login":"bradjc","id":1467890,"node_id":"MDQ6VXNlcjE0Njc4OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1467890?v=4","gravatar_id":"","url":"https://api.github.com/users/bradjc","html_url":"https://github.com/bradjc","followers_url":"https://api.github.com/users/bradjc/followers","following_url":"https://api.github.com/users/bradjc/following{/other_user}","gists_url":"https://api.github.com/users/bradjc/gists{/gist_id}","starred_url":"https://api.github.com/users/bradjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradjc/subscriptions","organizations_url":"https://api.github.com/users/bradjc/orgs","repos_url":"https://api.github.com/users/bradjc/repos","events_url":"https://api.github.com/users/bradjc/events{/privacy}","received_events_url":"https://api.github.com/users/bradjc/received_events","type":"User","site_admin":false},"created_at":"2018-07-30T17:21:48Z","updated_at":"2018-07-30T17:21:48Z","author_association":"CONTRIBUTOR","body":"> I think this is exactly the kind of iterative change/churn that makes keeping up with Tock difficult and which I'd like to avoid.\r\n\r\nI want to note that a useful change can be made without any changes outside of the capsules crate."}}
{"actor":{"display_login":"bradjc"}}