Minimal linear codes are widely used in secret sharing schemes and secure two-party computation. Most of the minimal linear codes constructed satisfy the Ashikhmin-Barg (AB for short) condition. However, up to now, only a small classes of minimal linear codes violating the AB condition have been presented in the literature. In this paper, we are devoted to constructing more classes of minimal linear codes over the finite field Fp that violate the AB condition and have new parameters. First, we provide several classes of minimal linear codes violating the AB condition from vectorial Boolean functions and determine their weight distributions. Then, we obtain new p-ary functions over the finite fields Fp with pan odd prime and determine their Walsh spectrum distributions. Finally, the resulted p-ary functions are employed to construct several classes of linear codes with two to four weights. In these codes, one class is minimal and violates the AB condition, and two classes satisfy the AB condition. (c) 2025 Published by Elsevier B.V.