Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I remember i2c support was added to the Linux kernel. I never understood what it is.

Next in line is BPF, which is also unclear.



I2C is basically "USB for things where USB would be overkill". It's a standardized protocol [1] that allows for one host to communicate with up to 128 different devices on a shared serial bus consisting of two wires. The specification does not define any discovery mechanism or higher-level functionality on top of basic packet sending and receiving, so I2C is meant to be used in cases where the host already knows what is connected and has the appropriate drivers set up (hence why embedded Linux devices typically use a "device tree" or similar configuration file to tell the kernel about their I2C hardware). Many of the chips used in modern electronics are either controlled entirely via I2C or use it as a configuration port in addition to a separate high-bandwidth interface for data; the accelerometer, power management chip, audio DAC, display and cameras in your phone all have I2C interfaces.

Another use case for I2C is device identification: since I2C-interfaced ROMs are so cheap, it's common to embed them in various types of peripherals and have the host read them out to retrieve information about the peripheral. This is how your PC gets to know which resolutions are supported by your monitor [2] (VGA, DVI and HDMI all have dedicated I2C pins for this purpose) and which type of RAM you have installed [3], for instance.

[1] https://en.wikipedia.org/wiki/I%C2%B2C

[2] https://en.wikipedia.org/wiki/Extended_Display_Identificatio...

[3] https://en.wikipedia.org/wiki/Serial_presence_detect


If you're talking about (e)BPF, the (extended) Berkeley Packet Filter, the easiest way to think about it is like a tiny virtual machine running inside the kernel, which can execute "simple" commands that would otherwise be very slow or very complex from within userspace. The traditional example would be counting the number of packets being sent out by a network interface. But it turns out that eBPF is massively more general purpose than that, allowing people to develop all kinds of monitoring applications.


I2C is a simple serial communications protocol typically used for things like configuring on-board devices and reading sensors.

BPF is anything but simple.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: