An operating system for a microcontroller is called a real time operating system (RTOS). There are many available, I can't recommend a particular one, but there are many available for many different types of microcontroller and many different scales of budget and time investment. An Arm Cortex M3 or M4 should be RTOS capable, I would hope that the PIC32 is also RTOS capable.
Here is a Raspberry Pi deployed in the IoT Watson Platform. I'm sending CPU temps from the Pi which is in a classroom to the cloud. I'm then doing IFTT to monitor room temp or determine sunrise and sunset that will be posted in a Google App. https://quickstart.internetofthings.ibmcloud.com/#/device/b827eba87c70
If you do not need the flexibility of a "dynamic" OS, I'd suggest considering some "static" OS. There's a lot of options available. To name a few: OSEK OS, FreeRTOS, µC/OS.
See eg. https://en.wikipedia.org/wiki/List_of_operating_systems | "Other Embedded"