Ok, the ABS light and brake warning light on indicated a problem in the ABS system, not the conventional part of the brakes such as the brake pads or brake shoes.
To know exactly why the light is on will require the ABS sytem being read with a diagnostic scanner with ABS capability.
With the speedometem not working either, it will most likely be either one of the front wheel speed sensors or the rear wheel speed sensor that is located at the top of the rear differential. Most of the time its the rear speed sensor, but with what the sensors cost, i would have the ABS system read for stored fault codes first, just so you arent replacing a perfectly good part.
2 or 4wd?
v.8 5.9liter 4w/d
Yes, the speed sensors are responsible for turning the ABS and brake warining lights on
Ok, to access the front wheel speed sensor you will need to remove the brake caliper and the rotor. The wheel speed sensor in bolted into the side of the hub that the rotor slides over.
Code 22 is no signal from the right front wheel sensor
Code 27 is intermittent signal loss from the left front wheel sensor
For code 27, you will need to trace the wiring from the sensor back and check for any loose connections or breaks in the wiring. If none found, replace the left wheel speed sensor