Adding a new object type

Syscall Interface

The syscall interface is defined in .fidl files in //zircon/vdso/. To add a new object type to that FIDL definition:

The FIDL toolchain bakes in knowledge of object types. This isn't elegant, but it avoids some circular dependencies. You'll have to update parts of the FIDL toolchain to understand your new object type. In particular, update:

Kernel Implementation

TODO(b/383761360): add it in the kernel

Userspace Support

Userspace developers want more than the raw C ABI, they expect language bindings and tooling support.

C++

The C++ syscall bindings are implemented in //zircon/system/ulib/zx/. Implement an appropriate zx::object subclass for your new object type.

Rust

The Rust syscall bindings are implemented in //sdk/rust/zx/. Implement an appropriate Handle wrapper type for your new object type.

fidlcat

The ffx debug fidl aka fidlcat tool is roughly analogous to strace on Linux. It's based on the fidl_codec library implemented in //src/lib/fidl_codec/. Teaching it about a new object type includes updating: