kernel: implementa get_next_number().

Signed-off-by: Francisco Prates <mad.kanie@gmail.com>