The libraries work since you are able to compile them and sketch is working, but I believe that is waiting more than it should due to the latency of the reading of the GPIO. Why don’t you try by using the Pin 2 and 3 that are faster? Let me know if that work
Unfortunately that's not going to work even on pins 2 and 3 due to the latency caused by changing the pin mode from input to output or vice versa. It just goes beyond the necessary 1-wire protocol timings due to all the muxing stuff going on.
Once pin is set to in or out (provided that's the one connected directly to Quark, i.e. #2 or 3 for Galileo Gen1), the communication is fast enough, but mode change is what kills it.
Theoretically it should be possible to create an additional external switcher, which would use two pins on the Galileo and connect to 1-wire and do the mode switches fast enough to keep up with the protocol timings, but no one has done it yet.
There's a nice project by SpiderKenny where he did make the 1-wire communication work by using Galileo's UART (pins 0 and 1) and some smart processing. It's not as versatile or "one-line" as the OneWire library, so you'd need to rework it for your specific case, but this may be a solution for you: Using Galileo to read 1-Wire (such as iButton) devices.
Thank you JP and Alex for your responses. I did not get the sensors to work directly from the galileo but instead have chosen to use another arduino to get the temperature sensor readings. It seems that the onewire sensors do require a very fast IO speed, something I was unaware of at the time.
Like I often say, Galileo is a computing system, not a processor, so the hardware is abstracted from the code, and devices like 1-Wire need to be attached using an appropriate interface. The UART on pins 0 and 1 is a perfectly acceptable interface. On boards like Galileo you should never try to drive IO pins directly, especially when deterministic timing is required, as you cannot determine when you program will be scheduled for execution, and when it will yield to other processes.
Using the UART gives you deterministic timing.