Formation of accretion disks and jets around black holes